Ask Question
11 February, 10:10

Which of the following can be used to get an integer value from the keyboard?

Integer. parseInt (stringVariable);

Convert. toInt (stringVariable);

Convert. parseInt (stringVariable);

Integer. toInt (stringVariable);

+5
Answers (1)
  1. 11 February, 11:44
    0
    Integer. parseInt (stringVariable);

    Explanation:

    This function is used to convert the string into integer in java. Following are the program that convert the string into integer in java.

    public class Main

    {

    public static void main (String[] args) / / main method

    {

    String num = "1056"; / / string variable

    int res = Integer. parseInt (num); / /convert into integer

    System. out. println (res); / / display result

    }

    }

    Output:1056

    Therefore the correct answer is:Integer. parseInt (stringVariable);
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Which of the following can be used to get an integer value from the keyboard? Integer. parseInt (stringVariable); Convert. toInt ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers