Archive for March 19, 2006

Programming tip #2 - Use a scrapbook page

If you are a java/j2ee developer who works on a eclipse IDE then you must already be using scrapbook effectively. If not, then it is high time you started using it. A scrapbook page helps you test a piece of code without the pain of writing an entire program. Say you want to test displaying “Hello World” on the console using java. Traditionally you would write something like below.

public class HelloWorld {
    public static void main(String[] args) {
      System.out.println(”Hello World”);
    }
}

But when you open a scrapbook page in eclipse, you just have to write the below statement,

System.out.println("Hello World");

To create a scrapbook page, once you are in eclipse, select one of the folders in your project and right click. Then select New->Other. From the window that opens, select Java->Java Run/Debug->Scrapbook Page. Once the page is created write the above statement. Highlight the statement and click the run button, voila “Hello World” gets printed in the console view. What happens behind is whatever is needed to execute the above statement is automatically added. Ofcourse the main purpose of the scrapbook page is to test a small piece of code, api and/or logic, so that you can save time typing in a complete program.

Blink this Programming tip #2 - Use a scrapbook page at blinklist.com    Bookmark Programming tip #2 - Use a scrapbook page at blogmarks    Bookmark Programming tip #2 - Use a scrapbook page at del.icio.us    Digg Programming tip #2 - Use a scrapbook page at Digg.com    Fark Programming tip #2 - Use a scrapbook page at Fark.com    Bookmark Programming tip #2 - Use a scrapbook page at Furl.net    Bookmark Programming tip #2 - Use a scrapbook page at NewsVine    Bookmark Programming tip #2 - Use a scrapbook page at reddit.com    Bookmark Programming tip #2 - Use a scrapbook page at Simpy.com    Bookmark Programming tip #2 - Use a scrapbook page at Spurl.net    Bookmark Programming tip #2 - Use a scrapbook page with wists    Bookmark Programming tip #2 - Use a scrapbook page at YahooMyWeb

Comments      Cosmos


Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.