String to Integer Conversion in Java

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
String to Integer Conversion in Java

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment