Which of the following statements is correct? A. Integer.parseInt("12", 2); B. Integer.parseInt(100); C. Integer.parseInt("100"); D. Integer.parseInt(100, 16); E. Integer.parseInt("345", 8);

Which of the following statements is correct?
A. Integer.parseInt("12", 2);
B. Integer.parseInt(100);
C. Integer.parseInt("100");
D. Integer.parseInt(100, 16);
E. Integer.parseInt("345", 8);


The correct answer is CE

Explanation: (A) is incorrect because 12 is not a binary number. (B) and (D) are incorrect because the first argument in the parseInt method must be a string.


Java

Learn More Multiple Choice Question :