Computer Science, asked by harsha116, 1 year ago

Method to convert string to a primitive data type.plz answer urgently

Answers

Answered by flower161
2
Converting String to int (or Integer) We can use the Integer.parseInt() to get the corresponding primitive int value of a String or use Integer.valueOf() to get the corresponding value of Integer wrapper class. If the string is not an integer, NumberFormatException will be thrown.
Similar questions