I passed the
SCJP exam yesterday with 81%.
the questions were all ok, except one that i could not think an answer for.
I don't remember it completely, but there was a statement between the try and catch, and should be giving a compiler error. However, the question was a short answer one and value of a
string variable was asked. it looked somethng like this:
public class Class
{
String counter = "";
void foo(int i){
try
{
if(i==0)
throw new Exception();
}
counter += "1";
catch
{
//some code
}
finally
{
//some code
}
}
public static void main(String [] args)
{
foo(1);
foo(0); //*****
}
}
what is the value of variable counter at //*****
My preparation:
I have done a little
Java a year ago, where I worked on an application using Java RMI and C++ to control robots through web.
Read HeadFirst Java, last week started reading Java Certification Book by Kathy S. and Bert B., really nice book, though I couldn't use it thoroughly, but I would have got a better score had i bought it earlier. I will highly recommend this book to anybody preparing for the exam.
And ofcourse, this forum, which cleared by hidden doubts about everything.
I am going for SCBCD now, and would like people's preparation recommendations.
Thanks
[ September 13, 2004: Message edited by: piyush jain ]