Just like String the Integer has many builtin functions that are used for different purpose and one of them is parseint which is used to convert a string into integer.
Source Code
public class Conversion { public static void main(String[] args) { System.out.println("\t \t \t LEP Tutorials \n "); String str = "366"; System.out.println(" The Value of String is : " + str); int num = Integer.parseInt(str); System.out.println(" The Value of Number is : " + num); } }
Output of the Program
String to Integer Conversion in Java |
0 comments:
Post a Comment