DEV Community

Guna Sekaran
Guna Sekaran

Posted on

Day 5 java Data types :

What is Data types?
Data types are classifications of data items in programming languages that specify the type of data a variable can store.

How many data types are there in java?
There are to types of Data types in java they are:
★primitive Data type
★non_primitive data type

Primitive data types: The basic building blocks of Java, each with a specific purpose:
byte: An 8-bit signed two's complement integer with a range of -128 to 127
short: A 16-bit signed two's complement integer with a range of -32,768 to 32,767
int: A 32-bit signed two's complement integer with a range of -231 to 231-1
long: A 64-bit two's complement integer with a range of -263 to 263-1
float: A single-precision 32-bit IEEE 754 floating point
double: A double-precision 64-bit IEEE 754 floating point
boolean: A data type with only two possible values: true and false
char: A single 16-bit Unicode character

Non_primitive data types:
★String
★array
★list,set,map
★object.

What is variable?
variables in Java language are the names used to refer to data stored in the memory. One Java variable can hold only a single type of data. Before using a variable while programming, it is necessary to declare a variable. It means to assign data to a particular memory and use a name for that memory.

What is reference variable?
A reference variable is a type of variable that holds the memory address of an object. It acts as a pointer to the object's location in memory, allowing you to access & manipulate the object's data & behavior.

What is method overloading?
Method overloading in Java means having two or more methods or functions in a class with the same name and different arguments or parameters.

Top comments (0)