Literals are used to create values that are assigned to variables. : Literal « Java Source And Data Type « SCJP






public class MainClass{
    public static void main(String[] argv){
    
        System.out.println(5); // 5 is a literal for int type
    }
}








1.7.Literal
1.7.1.Literals are used to create values that are assigned to variables.
1.7.2.Literal Values for All Primitive Types
1.7.3.Literal integer numbers can appear in Java programs in base ten, hexadecimal, and octal forms