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 Another Dan's erroneous definition? 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 "Another Dan Watch "Another Dan New topic
Author

Another Dan's erroneous definition?

Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
This is from comprehensive exam 10:

Question 17
Which of the class instance creation expressions would produce a run-time error?
a. Long.parseLong("1")
b. Long.parseLong("1L")
c. Long.parseLong("010")
d. Long.parseLong("0x10")
e. Long.parseLong("1.0")

There are no class instance creation expressions in this question. If it were valueOf(String str), then probably yes.
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
I agree that no instance creation can be inferred from reading the API for Long.parseLong


SCJP2. Please Indent your code using UBB Code
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
I even looked at the code and there is no instance creation except for instantiation of a NumberFormatException if the String contains non-numeric data.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Originally posted by Vad Fogel:
There are no class instance creation expressions in this question. If it were valueOf(String str), then probably yes.

You are correct. They are obviously method invocation expressions. If you see any more of those types of errors, the please let me know.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Another Dan's erroneous definition?