If you wish to test an expression without writing a class with a public static void main(String args[]), java scrap pages is what all you need. Play with scraps, it's fun.
1. In eclipse, select File -> New -> Other -> Java Run/Debug -> Scrpabook Page
select a project which is there in eclipse and type a name in 'File Name' eg., MyTestscrap and then select 'Finish'
2. Now you can execute expressions by just typing in the expression (snippet) and selecting the whole code and then selecting ctrl+shift+D
3. You can see the result in the preselected String present next to your expression.
4. To see the fun, execute the below:
> System.getProperties()
> new java.util.Date()
> 3+30
> "Java is cool".length()
> String s="Eclipse";
String t="is good";
s+t
5. Instead of opting for a display (ctrl+shift+D), it's better to inspect the whole expression by using ctrl+shift+I
1. In eclipse, select File -> New -> Other -> Java Run/Debug -> Scrpabook Page
select a project which is there in eclipse and type a name in 'File Name' eg., MyTestscrap and then select 'Finish'
2. Now you can execute expressions by just typing in the expression (snippet) and selecting the whole code and then selecting ctrl+shift+D
3. You can see the result in the preselected String present next to your expression.
4. To see the fun, execute the below:
> System.getProperties()
> new java.util.Date()
> 3+30
> "Java is cool".length()
> String s="Eclipse";
String t="is good";
s+t
5. Instead of opting for a display (ctrl+shift+D), it's better to inspect the whole expression by using ctrl+shift+I
0 comments:
Post a Comment