Introduction about java:
java is a staticaly type programming language. java is a high-level,class- based,object oriented programming language that is designed to have as few implementation dependences as possible.
Designed by: james goasling.
First appeared:may 23,1995;26 years ago.
Latest release: java se 16(16 march 2021).
Why java:
Java was designed by easy to use and is therefore easy to write,compile,debug,and learn than other programming languages.
What is JDK,JVM,JRE in java:
JDK: java developmentkit.it is used to convert the .Java programming to .class file.
JVM: java virtual mechine its used to convert the .class file to Binary file(0,1s).
JRE: java runtime environment runs on top of the OS and provides additional java-specific resources.
Datatype in java:
Data type specify the different sizes and values that can be stord the variables.there are two types
Primitive data type: the primitive data type include boolean,char,byte,short,int,long,float and double.
Non-primitive data types: the non-primitive data types include Classes,Interfaces, and Arrays.
| Data Type | Size | Description |
|---|---|---|
byte | 1 byte | Stores whole numbers from -128 to 127 |
short | 2 bytes | Stores whole numbers from -32,768 to 32,767 |
int | 4 bytes | Stores whole numbers from -2,147,483,648 to 2,147,483,647 |
long | 8 bytes | Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
float | 4 bytes | Stores fractional numbers. Sufficient for storing 6 to 7 decimal digits |
double | 8 bytes | Stores fractional numbers. Sufficient for storing 15 decimal digits |
boolean | 1 bit | Stores true or false values |
char | 2 bytes | Stores a single character/letter or ASCII values |