File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What will be in Real SCJP  Exam 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 "What will be in Real SCJP  Exam " Watch "What will be in Real SCJP  Exam " New topic

What will be in Real SCJP Exam

Mr. mangal pandey

Joined: Nov 30, 2005
Posts: 1
Hi all,

I am a new member.I have few doubts on real scjp exam.
if the question pattern is like,

Q. Consider the following lines of code:

Integer i = new Integer(42);
Long ln = new Long(42);
Double d = new Double(42.0);

Which of the following options are valid?

???<Select 2 correct options >

a i == ln;
b ln == d;
c i.equals(d);
d d.equals(ln);
e ln.equals(42);

Will it be there in the question that how many correct answer(???) needs to be selected.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Yes, in the SCJP 1.4 and 5.0 exams you will be told the number of correct options out of those given. In the SCJP 1.2 exam (if it is still offered), you will not be told.
[ November 30, 2005: Message edited by: Barry Gaunt ]

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

Joined: Nov 30, 2005
Posts: 54
correct answer??
g.vinodh kumar

Joined: Nov 23, 2005
Posts: 5
Answer is c and d.

== -> cant be used to compare two different types. so a and b are wrong.
.equals() -> can be used to compare with an object. so e is wrong.

G. Vinodh Kumar.
Bert Bates

Joined: Oct 14, 2002
Posts: 8898
The *real* exam will tell you how many correct answers a question has. Many mock exams (including ours) say something like "choose all that apply." I can't speak for other mock question writers, but we do that to make the questions harder.

Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
veesam sridhar
Ranch Hand

Joined: Oct 18, 2005
Posts: 51

Here the Question is which options are valid --not which options output true

am I correct(correct me if not),In this case C,D are correct answeres

If the question is Which outputs true...

Then C,D doesn't give true.

am i rite,plz clarify ..

Thanks in advance
Mahendar Reddy
Ranch Hand

Joined: Sep 27, 2005
Posts: 73
Yes Sridhar, options C & D will give "false" as output.B'coz they won't
pass instanceof test.

SCJP- 98%<br />SCWCD-92%
Vijayagopalan Raveendran
Ranch Hand

Joined: Apr 18, 2005
Posts: 41
In Java 1.5 option will give true.

for eg,output for the snippet will result in both true.
equals() of the wrapper classes can take primitive value also.

public class Test100
public static void main(String cmd[])
int i = 42;
Integer in = new Integer(42);


System.out.println(new Long(42).equals(42L));

Vijay<br />SCJP 1.5 / SCWCD 1.4 / SCDJWS 1.4 / SCBCD 5/ SCEA 5 (P1)/ SOA 667
I agree. Here's the link:
subject: What will be in Real SCJP Exam
It's not a secret anymore!