aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Jxam 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 "Jxam" Watch "Jxam" New topic
Author

Jxam

Vivek Shrivastava
Ranch Hand

Joined: Jun 03, 2000
Posts: 277
Hi,
This questionis from Jxam mock exam. i think given answer is wrong.
Consider the following piece of code and select the correct statements.

1. Object o = new String("abcd");
2. String s = o;
3. System.out.println(s);
4. System.out.println(o);
1. The following is displayed:
abcd
abcd
2. The code fails to compile at line 1
3. The code fails to compile at line 2
4. The code fails to compile at line 4
5. The code can be made to compile by changing line 1 to the following:
String o = new String("abcd");
Given answer is '3' but i think correct answer is 3,5.
please do verify it.
vivek
[This message has been edited by Vivek Shrivastava (edited July 29, 2000).]
Chris Cleverley
Greenhorn

Joined: Mar 09, 2007
Posts: 22
The answer is indeed 3) and 5).
5) is correct, no doubt about it.
Chris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jxam
 
Similar Threads
Jxam question
Another Jxam question
Jxam question
Jxam question errata
JXAM Qs....