Ask Question
26 September, 12:44

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);

+1
Answers (1)
  1. 26 September, 15:27
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers