Integer: parseInt(String stringValue) : Integer « java.lang « Java by API






Integer: parseInt(String stringValue)

 
/*
 * Output:
 
Sum is 8

 */

public class MainClass {

  public static void main(String args[]) {

    int i = Integer.parseInt("3");

    int j = Integer.parseInt("5");

    int sum = i + j;
    System.out.print("Sum is " + sum);
  }
}
           
         
  








Related examples in the same category

1.Integer.MAX_VALUE
2.Integer: MIN_VALUE
3.Integer: Integer.SIZE
4.Integer: bitCount(int i)
5.Integer: equals(Object obj)
6.Integer: highestOneBit(int i)
7.Integer: intValue()
8.Integer: lowestOneBit(int i)
9.Integer: numberOfLeadingZeros(int i)
10.Integer: numberOfTrailingZeros(int i)
11.Integer: reverseBytes(int i)
12.Integer: rotateLeft(int i, int distance)
13.Integer: signum(int i)
14.Integer: toBinaryString(int intValue)
15.Integer: toHexString(int intValue)
16.Integer: toOctalString(int intValue)
17.Integer: valueOf(String stringValue)