+ 1
Casting from string to int
In Java language How can we cast an String to Integer ? For example : String a = "57" int b = 43 System.out.print(a+b); How can we convert variable a or its value to int so that we can output 100 ?
2 Antworten
+ 1
Integer.parseInt(a) -> Integer
+ 2
I got it.
I need to do:
System.out.print(Integer.parseint(a)+b);