Set an Integer Variable

Integer was added in API Level 1

1. Create an Integer variable named myInteger.

2. In the MainActivity.java file, add the following line. This will get an instance of an integer. This will set the myInteger variable to the value of 1.

myInteger = 1;

3. Compile and run!

Next Recommended Article:

Resources: