• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

do these type of questions really come in exam ?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well we did apologize ;)
 
Surender Suri
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hope they don't appear on exam though :-) .. anyway thanks bert for the amazing book
 
lowercase baba
Posts: 13081
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic