Multiple choice

What is the method used to convert String variable to primitive integer

  1. Integer.parseInt(String str)

  2. Integer.convertInt(String str)

  3. Integer.valueOf(String str)

  4. Integer.toInteger(String str)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This answer is correct. To convert a String to a primitive integer, static method parseInt(String str) is executed. This will take the String variable and convert to primitive integer