Computer Applications

What is the type of parameter to be given for the method parseInt()?

  1. double
  2. String
  3. char
  4. int

Java Library Classes

3 Likes

Answer

String

Reason — The method Integer.parseInt() is used to convert a numeric value given in String form into an integer. Therefore, it requires a String parameter as input, not double, char, or int.

Answered By

2 Likes


Related Questions