• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

do these type of questions really come in exam ?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 8995
19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well we did apologize ;)
 
Surender Suri
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hope they don't appear on exam though :-) .. anyway thanks bert for the amazing book
 
lowercase baba
Posts: 12760
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean "Do they ask questions where the correct answer is "compilation fails", the answer is "Yes, at least when I took it".
 
Bert Bates
author
Posts: 8995
19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
You get good luck from rubbing the belly of a tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!