permaculture playing cards*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Errors in the K&B bonus exam? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Errors in the K&B bonus exam?" Watch "Errors in the K&B bonus exam?" New topic
Author

Errors in the K&B bonus exam?

Tim Rawerts
Ranch Hand

Joined: Mar 08, 2005
Posts: 38
Has anyone else encountered errors in the K&B bonus exam?

I was taking the open book exam, and one questions was creating three long two dimensional arrays, and playing with the elements. The correct answer was D, with the explanation of:

D) compilation error at line 5

D is correct. It is a legal way to create an array of four integers, name 'array'.

There is no 4 dimensional array, and there is no array named 'array'. Also if it is a correct way of creating this array, then compilation error at line 5 is not correct either.

Thanks for your input.

Tim Rawerts
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
Hi,Tim.

the open book exam? how many questions you do ? the default number of questions are 65 right?

and why dont you type the whole question here for members here to take a look....

i also wonder what were you talking about...

thanks.


From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
Tim Rawerts
Ranch Hand

Joined: Mar 08, 2005
Posts: 38
Your first two questions make no sense, but here is the question in it's entirety.

public Test{
public static void main(String [] args}
long [][] a1;
long []a2[];
Tim Rawerts
Ranch Hand

Joined: Mar 08, 2005
Posts: 38
Your first two questions make no sense, but here is the question in it's entirety.

public Test{
public static void main(String [] args)
long [][] a1;
long []a2[];
a2 = new long[3][];
a1 = a2;
System.out.println(a1[1][0]);
}
}



a) 0
b) null
c) compilation error at line 5
d) compilation error at line 6
e) compilaiton error at line 7
f) runtime exeception is thrown at runtime


I chose f. Here is the answer I was given

D is correct. It is a legal way to create an array of four integers, named 'array'.

A,B,C,E,F ar invalid attempts to declare and initialize an array, none of them will compile.
Rupak Khurana
Ranch Hand

Joined: Mar 01, 2005
Posts: 89
The correct code that compiles is :-

public class Test{
public static void main(String [] args)
{
long [][] a1;
long []a2[];
a2 = new long[3][];
a1 = a2;
System.out.println(a1[1][0]);
}
}

It produces the putput :-

java Test
Exception in thread "main" java.lang.NullPointerException
at Test.main(Test.java:8)


SCJP 1.5<br />SCWCD 1.4
Tim Rawerts
Ranch Hand

Joined: Mar 08, 2005
Posts: 38
OK, I think people are missing the point. I am not looking for the correct answer, but rather has anyone else found errors in the sample exams?

Tim Rawerts
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
your demand is confusing me.
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
Hi Tim,

I spotted a couple of questions with wrong answers while attempting the K&B's MasterExam mocks. I agree with you the answer should be f.

Joyce
Tim Rawerts
Ranch Hand

Joined: Mar 08, 2005
Posts: 38
Thank you very much Joyce. That is twice now you have helped me out, and I appreciate it.

Tim Rawerts
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8883
    
    5
Hi Tim -

I'm jamming on the 1.5 update right now, so I don't have time to research this, but I think if you go to the Osborne site there is an errata that talks about this error - not sure, just kind of rings a bell. In general, I think the practice exams are very clean - maybe only one or two errors - again this is just what I recall.

HTH,

Bert


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Tim Rawerts
Ranch Hand

Joined: Mar 08, 2005
Posts: 38
Thanks Bert. I think it is way cool that you post here. The book is tremendous, and I have not doubts I will pass the exam tomorrow morning.

Tim Rawerts
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
I give test on Saturday morning.

all the best to both of us....

hope to hear your result. i'm sure you can pass it easily.
Mike Sanders
Greenhorn

Joined: Jun 27, 2005
Posts: 15
Yes, I remember coming across this buggy question a couple of times when I was doing the practive exams last week...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Errors in the K&B bonus exam?