Source Code : Decode string to integer

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Decode string to integer

  
 
public class Main {
  public static void main(String[] args) {
    String decimal = "10"; // Decimal
    String hexa = "0XFF"; // Hexa
    String octal = "077"; // Octal

    Integer number = Integer.decode(decimal);
    System.out.println("String [" + decimal + "] = " + number);

    number = Integer.decode(hexa);
    System.out.println("String [" + hexa + "] = " + number);

    number = Integer.decode(octal);
    System.out.println("String [" + octal + "] = " + number);
  }
}

   
    
  

Thank with us