Some of the methods in the Integer class are shown below:
public static String to String(int i)-Returns a new String object representing the specified inter. The radix is assumed to be 10
public static int parseInt(String s) throws Numer Format Exception - Assuming the specified String represents an integer (if not, thows NumberFormatException), returns that integer's value.Radix is assume to be 10.
public static integer valueof (String s)Throws NumberFormatException - Assuming the specifisd String represents an integer(if not,thows NumberFormatExcepttion), returns a new Integer object initialized to that value.Radix is assumed to be 10.
public int intValue( ) - Returns the value of this Integer object aas an int.
public long longValue( ) - Returns the value of this integer object as a long.
public float floatValue( ) - Returns the value of this Integer object as a float.
public double doubleValue( ) - Returns the value of this integer object as a double.
public String toString( ) - Returns a String object representing this Integer's value.
public boolean equals (Object obj) - Compares this object to the specified object, returning true if the values or contents of the objects are the same.
    1 public class MyInt{
        2 public static void main (String args[]) {
        3       Integer X;
        4       int x;
        5       double Y;
        6       string stry = args[0]; // assumes one argument to program
        7       // Create an Integer object from a string
        8       X = Integer.valueOf("34");
        9       
        10      try {  // not every string can be an integer !!!
        11          x = Integer.parseInt(stry);   // Convert string to integer
        12          System.out.println("x is:" + x + ", converted from string");
        13      } catch (NumberFormatException e) { // it's not an integer
        14          System.out.println("Argument is not an integer.Exit...");
        15          System.exit(1);
        16      }
        17      y = X.doubleValue(); // Integer to double
        18      
        19      System.out.println("X converted to double: " + y);
        20      
        21      // Convert Integer object to a String
        22      System.out.println("X as a Stting:"+X.to string());
        23 }
  24 }
This program produces the following output.
$ java MyIntSynopsis
public final class Long extends Number
long i; /* long variable i */
Long I; /* Long object I */
Long Methods and Variables
The methods and variables in the Long class closely resemble those of the Integer class.Refer to Appendix B for the complete syntax.
      You can take the program from the previous page and replace all int
      and Integer keywords with long and Long,respectively,to obtain a
      program that uses methods in the Long class.
      
      Such a program is shown on the next page, and produces the output
      shown below.
        $ java MyLong
        Argument to program is not an integer.
        $ java MyLong 13
        x is: 13,converted from string.
        x converted to double :34 
        x as a String: 34
Example 2. Converting Long.
        public class MyLong {
           public static void main ( String args [ ] )  {
           Long X;
           long x; 
           double y;
           String stry = args[0]; // assumes one argument to program
           // Create an Long object from a string
           X= Long.valueOf ( "34 );
           try { 
              x = Long.parseLong(stry); // Convert string to integer
              System.out.println ("x is: " + x + ", converted from string. ");
           } catch ( NumberFormatException e )  {
              System.out.println("Argument to program is not an interger.");
              System.exit( 1 );
           } 
           y = X.doubleValue( );
           System.out.println("X converted to double: " + y );            
	
           // Convert Long object to a String
            System.out.println("X as a String: " +  X.toString( ) );
           }
 
       } 
pablic final class Float extends Number
flop f; /* float variable f */
Flop F: /* Floap Object F*/
The constructors for the Float class are shown below:
public Float (String s) throws NumberFormatException - Constructs a Float object initialized to the value specified by the String parameter.
Float Variables
Below are the instance variables defined in the Float class:
public final static float MIN_VALUE - The lowest minimum value possible for a float(1.40129846432481707e-45).
public final static float MAX_VALUE - The lowest maximum value possible for a float(3.40282346638528860e+38).
public final static floatNEGATIVE_INFINITY - Negative infinity.
public final static float POSITIVE_INFINITY - Positive infinity.
public final static float NaN - Not a number (it is not equal to anything, including itself).
Float Class (Continued)
Below are some of the methods of the Float class:
public static native String toString(flot f) - Returns a String representation for the specified float value.
public final class Double extends Number
Declarations
double v; /* double variable v */
Double V; /* Double object V */
Double Methods and Variables
The methods and variables in the Double class closely resemble those of the Float class.Refer to Appendix B for the complete syntax.