English

Given: kd = Integer.parseInt("3"); Datatype of kd is:

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]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 5 Library Classes
Exercises | Q 1. (ix) | Page 134
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×