| Author |
do these type of questions really come in exam ?
|
Surender Suri
Ranch Hand
Joined: May 28, 2010
Posts: 41
|
|
Do these type of questions really appear on real exam ? this question is from K&B mock exam.. i have seen couple of then in K&B mocks and i did wrong most of the time :-( .. i don't know what they are trying to test here .. my observation skills ? it's more like an eye test :-)
since most of you are certified .. did any one seen these type of question in real exam ?
What is the result?
A. 1 1 1
B. 2 0 1
C. 2 0 2
D. 2 2 2
E. Compilation fails.
F. An exception is thrown at runtime.
E is correct. We had to throw at least one of these in here, sorry. The reverse() and sort() methods are in the Collections class, not the Collection class—ouch. Again, look for this kind of misdirection in the real exam! If the invocations had been Collections.reverse(desk) and Collections.sort(desk), the result would have been 2 0 1—remember, indexes are zero-based.
|
Thanks,
Suri
|
 |
Bert Bates
author
Sheriff
Joined: Oct 14, 2002
Posts: 8717
|
|
|
well we did apologize ;)
|
Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
|
 |
Surender Suri
Ranch Hand
Joined: May 28, 2010
Posts: 41
|
|
|
hope they don't appear on exam though :-) .. anyway thanks bert for the amazing book
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10032
|
|
|
If you mean "Do they ask questions where the correct answer is "compilation fails", the answer is "Yes, at least when I took it".
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Bert Bates
author
Sheriff
Joined: Oct 14, 2002
Posts: 8717
|
|
Frank, your answer won't compile (wouldn't pass a lint test)
More seriously, the exam creators aren't trying to be tricky - they're trying to test for common errors. In the old days the exams were meant to be tricky, lately we've moved away from such a tricky approach. For example, don't memorize API details, but DO know that parseXXX() methods tend to throw exceptions.
|
 |
 |
|
|
subject: do these type of questions really come in exam ?
|
|
|