Give examples of the Built in Data Types of Java.
Advertisements
प्रश्न
Give examples of the Built in Data Types of Java.
सविस्तर उत्तर
Advertisements
उत्तर
The examples of built-in data types of Java are as follows:
- byte: It is used to store small integer values. Example:
byte a = 10; - short: It is used to store integer values. Example:
short b = 200; - int: It is used to store whole numbers. Example:
int age = 18; - long: It is used to store large integer values. Example:
long population = 1000000L; - float: It is used to store decimal numbers with single precision. Example:
float marks = 85.5f; - double: It is used to store decimal numbers with double precision. Example:
double price = 125.75; - char: It is used to store a single character. Example:
char grade = 'A'; - boolean: It is used to store logical values, either
trueorfalse. Example:boolean result = true;
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
