In this example we will show the method to create an integer variable in Java.
Source Code
package com.beginner.examples;
public class IntegerVariable {
public static void main(String[] args) {
int i = 7; // integer variable
System.out.println(i);
}
}
Output:
7