This is a query related to Vara Raju's example. for the first example (a==b) will be false just because they will refer to different memory location in the non-pool memory? Am i correct? [ September 10, 2008: Message edited by: Sambit Banerjee ]
Bert,as you have asked for my jdk version i thought i have a problem with it.So,i have checked it in my friend's pc and i found no problem with Integer.parseInt(arg). But i have checked the options also and still find that except option b all the options compile the code. Here's the exact code.
for the second question if you do it manually then it will be like this: x=1+1+2-2+2+4 so the answer comes to 8. i hope you have got it now,if you have any problem then i can give you an explanation.
@ pranav, actually i was getting the follwing compiler error: Ping.java.18:cannot find symbol symbol:method parseInt(String) location:class java.lang.Integer return Integer.parseInt(arg); 1 error. so i thought that double quotes should be used.
i think line 7 needs some modification,the arg in Integer.parseInt() should be in double quotes.and barring option b all the options seem to be right but in the answer it is given only options a and c are correct. please check this and reply.
this is from chapter-4,page-302,question-4,(k&b book)
At runtime i am getting the exception that- Exception in thread "main" java.lang.NoSuchMethodError:main Should'nt it be ArrayIndexOutOfBoundsException as given in the answer. please help.
Bert, all i could understand is that previously it was Short story=5; later you changed that to Short story=200; and that I should consider Short story=200; am i right or its something else?