SCJP 96% | SCWCD 90%| SCJP mock exams | My SCJP blog
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
int x;
if(true) x=1;
System.out.println(x);
int x;
if(false) x=1;
System.out.println(x);
Treimin Clark wrote:
Warning: But you should note that if expression will be evaluate, for the purpose of checking for local variable initialization. For an example:
int x;
if(true) x=1;
System.out.println(x);
The above code compiles, but the code below will not:
int x;
if(false) x=1;
System.out.println(x);
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
SCJP 6
Abhi vijay wrote:
In this case when throw new Exception(); then an Exception is thrown and the associated catch block executes, then the control never comes back to the method, so System.out.println("e"); is an Unreachable statement??? Whys is the compiler not detecting it?
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
All code in my posts, unless a source is explicitly mentioned, is my own.