File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Green's Mock Exam 1 Question. 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 "Marcus Green Watch "Marcus Green New topic
Author

Marcus Green's Mock Exam 1 Question.

Vishy Karl
Ranch Hand

Joined: Sep 08, 2003
Posts: 116
Hi Friends,
Following question is asked in Marcus Exam.

Answer
Compilation and output of BillKathyCarl

Now just wanted to know that will such questions be there in real exam too ? becoz as far as I know we are supposed to know which is the best interface to select for particular situations. Now the above question requires you to know the methods like
tm.put("a","Bill"); &
tm.keySet().iterator();
So we should know these basic methods too ?? what else is required to be known ??
Thanks in advance.


"The man who can drive himself further once the effort gets painful is the man who will win." <br />Roger Bannister
Mohit Goyal
Ranch Hand

Joined: Nov 09, 2003
Posts: 65
Well i too took the Marcus Exam yesterday and got 90% in that.
I also encountered the same question and after some thought i got it right .
Well u should know the basic methods such as put, get , iterator, etc.
But the keyset() method was a bit hard if u have read the K&B book. I figured out that since the TreeSet is sorted by natural order, using keyset().iterator() wud cause the iteration to be in natural order of the keys. Since the keys represent String the natural order wud be alphabetical.
Still i m also a bit confused about whether i shud study the API for Collections Framework or not. i will be taking my exam next week so its an area of concern for me.
Hope Bert & Kathy clearify this
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
The answer I have given is as follows.
"Compilation and output of BillKathyCarl
The TreeMap class stores the keys rather than the values in sorted order"
I am not certain exactly how much depth you are expected to know on the methods and uses of the collection classes, but I know you need to know which classes cause elements to be unordered, ordered and which sorted, and that is at the heart of this question.


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Vishy Karl
Ranch Hand

Joined: Sep 08, 2003
Posts: 116
Thanks to all for your replies.
Bye
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marcus Green's Mock Exam 1 Question.
 
Similar Threads
TreeMap
Collections
Will Collection class methods come in SCJP1.4 exam?
Incompatible types
Another question from mock exam