Today we will know what literal is in Java programming language.
What is litrels?
Literal is the number or text that expresses the value. Such as 100, tectonics, 123 four etc. These three literals are literal. There are a few types of liters in Java. We will know today about Antigen Literal
What is integer literal?
The person who publishes the integheara 10,20,50 full numbers is called an integer literal.
The type of integer literal in Java
Decimal Literals
Octal Literals
Hexadecimal Literals
Binary Literals
Long Literals
Values with Underscore in Between
Basically these six types of integer type have literals in Java.
Code:
/ **
Created by Asif on 8/11/2017.
Web: techasif.com
Email: [email protected]
Youtube: tech asif
/
Public class IntLiterals {
Public static void main {String args []) {
Int a = 100; // is inte is a data type and a is a variable and 100 is integer literals
Int b = 0b1010;
Int c = 023;
Long d = 500 l;
Int e = 0x14F;
Int f = 1_00000005;/*System.out.println("The value of a is "+ a); System.out.println ("The value of is" + b); System.out.println ("The value of c is" + c); System.out.println ("The value of d is" + d); System.out.println ("The value of e is" + e); System.out.println ("The value of f is" + f); * /
}
}
We have written the int a = 100; Here the 100E is a literal type of integer.
So the values are literal.
Come to understand.