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
posted
0
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
posted
0
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.