| Author |
Declaration and Access control question
|
Matt Ghiold
Ranch Hand
Joined: Feb 24, 2002
Posts: 213
|
|
Question ID :952739447900 [TRIAL] Given the following program, which statment is true? class SomeClass { public static void main( String args[ ] ) { if (args.length == 0 ) { System.out.println("no arguments") ; } else { System.out.println( args.length + " arguments.") ; } } } Ok, the answer according to J+ is that this program will throw a null pointer exception at runtime, but when I compile and run this class exactly as is, I get no arguments printed. Can someone please confirm if I am correct or not? Thanks, Matt
|
-Matt<br /> SCJP2<br /> SCJD
|
 |
Rajinder Yadav
Ranch Hand
Joined: Jan 18, 2002
Posts: 178
|
|
Matt, if you can compile and run a java program then you already have your answer
|
<a href="http://www.rajindery.com" target="_blank" rel="nofollow">Rajinder Yadav</a><p>Each problem that I solved became a rule which served afterwards to solve other problems. --Rene Descartes
|
 |
 |
|
|
subject: Declaration and Access control question
|
|
|