This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Boolean doubt - simple Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Boolean doubt - simple" Watch "Boolean doubt - simple" New topic
Author

Boolean doubt - simple

raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135
6) Which of the following are acceptable?
1) Object o = new Button("A");
2) Frame f = new Panel();
3) Boolean flag = true;
4) Boolean flag = true;
5) Panel p = new Applet();

Answer for the above, in a mock, mentioned as 1 & 5
But i thought, it is 1, 3,4 & 5
Am i right?


live
Andy Morris
Ranch Hand

Joined: May 30, 2004
Posts: 78
Was the mock for Java 5 or 1.4?

Answers 3 and 4 (which both are the same so i wonder if you've typed it incorrectly) use autoboxing which was a new feature in Java 5.
raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135
the mock found at http://www.4tests.com/
question number is 6
Andy Morris
Ranch Hand

Joined: May 30, 2004
Posts: 78
That exam is for the 1.4 certification.

That means special features of the language such as autoboxing will not be present and so wrapper objects like Boolean can not be assigned primitive values such as 'true'.

You need to decide which certification you'd prefer (I can't really see why you'd go for 1.4 when you can do the Java 5 one instead), and then choose mock exams appropriately or ignore questions that aren't compatible between the two exams.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
It does not look like SCJP 1.4 to me. The question looks as if it is from SCJP 1.2!


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135

Im preparing for scjp 1.5
Thanks for saving from 1.4 trap.
suggest me some really 1.5 mocks, please
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Boolean doubt - simple
 
Similar Threads
Boolean
boolean_true_check
errata or ??
Summation of `multiples of 5` which sums to a given target
ResultSet: I want a conditional output before iterating through it.