Java Revision
What is java ?
Java is a high-level, object-oriented programming language originally developed by Sun Microsystems and released in 1995. It is designed to be platform-independent, meaning that Java programs can run on any device that has a Java Virtual Machine (JVM) installed, regardless of the underlying hardware and operating system.
JVM (Java Virtual Machine): Executes Java bytecode on different platforms.
JRE (Java Runtime Environment): Includes the JVM and libraries for running Java applications.
JDK (Java Development Kit): Full toolkit for Java development, including JRE, compiler, and tools.
hello world
Program
public class HelloWorld {
public static void main (String [] args){
System.out.println("Hello World");
}
}
Variables In Java
Variable is just a container which stores data.
Primitive Data Types
Integer
byte
short
int
long
Float
float
double
Characters
Boolean
Size of the data types
Data Type | Size (in bits) | Highest Value |
byte | 8 | 127 |
short | 16 | 32,767 |
int | 32 | 2,147,483,647 |
long | 64 | 9,223,372,036,854,775,807 |
float | 32 | Approximately 3.4E38 |
double | 64 | Approximately 1.7E308 |
char | 8 | 65,535 (represents ' ' in Unicode) |
boolean | - | true or false |
Subscribe to my newsletter
Read articles from Rohit Rajvaidya directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by