Int Datatype in Java

Int:
int is 32 bit signed type ranges from –2,147,483,648 to 2,147,483,647. int is also most commonly used integer type in Java.

Syntax:
Declare int varibale as below
int <variable name> = <default value>;

Note:
here assigning default value is optional.

public class Int {
         public static void main(String[] args) {
                 int f = 1;
                 int c = 7;
                 
                 System.out.println("Value of int variable f is :" + f);
                 System.out.println("Value of int variable c is :" + c);
        }
}
 


Output:
Value of int variable f is:1
Value of int variable c is:7