There are two methods available in java to convert string to integer.
One is
Integer.parseInt() method and another one is
Integer.valueOf() method. Both these methods are static methods
of java.lang.Integer class. Both these methods throw
NumberFormatException if input string is not a valid integer.
num = '10'
# check and print type num variable
print(type(num))
# convert the num into string
converted_num = int(num)
# print type of converted_num
print(type(converted_num))
# We can check by doing some mathematical operations
print(converted_num + 20)
<script>
function convertStoI() {
var a = "100";
var b = parseInt(a);
document.write("Integer value is" + b);
var d = parseInt("3 11 43");
document.write("</br>");
document.write('Integer value is ' + d);
}
convertStoI();
</script>