Advertisements
Advertisements
Question
Given:
kd = Integer.parseInt("3");
Datatype of kd is:
Options
Integer
String
char
int
MCQ
Advertisements
Solution
int
Explanation:
The method Integer.parseInt() is a built-in Java function designed to convert a text string into a primitive whole number. Because the official return type of this method is the primitive integer data type, the variable kd must be an int.
shaalaa.com
Is there an error in this question or solution?
Chapter 5: Library Classes - Exercises [Page 134]
