Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

What happens when you attempt to compile and run the following code?

  1. public class WrapperTest{
  2.  public static void main(String args[]){
  3.   String str = "2b";
  4.   int i = Integer.parseInt(str,16);
  5.   System.out.println(i);
  6.  }
  7. }
a. The code will not compile.
b. The code will compile but will throw NumberFormatException when executed.
c. The code will compile and print 43 when executed.
d. None of the above.
No votes yet
Share this

Post new comment

8 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.