What is literal in Java?
What is literal in Java?
Literal in Java is a synthetic representation of boolean, numeric, character, or string data. It is a means of expressing particular values in the program, such as an integer variable named ''/count is assigned an integer value in the following statement. int count = 0; A literal '0' represents the value zero.
Literals are the actual values that are of specific data type. For eg. if you say that a car is a data type, then range rover is a literal. Formal explanation is that int is a data type and say the value 7 is a literal.
|
Bookmarks