Skip to main content
JAVA TUTORIAL : 4 (DATA TYPES AND LITERALS)
Data types is a classification in programming languages which indicates the type of value a variable can store. Different types of values are there & different operations are there for every data type.
Data types in Java are classified into two types:
Primitive—which include Integer, Character, Boolean, and Floating Point.
Non-primitive—which include Classes, Interfaces, and Arrays.
Non-Primitive data types are basically defined by the programmers and primitive ones are already defined in the programming languages like Java.
For Example:
Integer nonPrimitive = new Integer(50);
A Literal
is the source code representation of a fixed value; literals are
represented directly in your code without requiring computation.
For Example:
Boolean isPrimitive = true;
In above line of code "Boolean" is a primitive data type and "true" is a Literal.
Link to Previous Post:
Java Java Java
Comments
Post a Comment