Tuesday, January 13, 2009

Eclipse Scrapbook

In eclipse you can write few lines of codes without having to write the entire class declaration and main method to execute the few lines. This feature is called scrapbook if you have a java enabled project create a new file with the extension as ".jpage".

The next step would be is to write a few lines of code in that page...

  1. String message="Hello %1$s";
  2. message = message.format(message,"Jane Doe");
  3. System.out.println(message);

The step after that would be is to select the lines of code you want to execute and access the right click menu

Select the execute option and the just the selected lines of code alone would be executed and outputted in the console. I use this feature to quickly test a few lines of code…

No comments:

Post a Comment