Java Intro & Get Started
Java is a popular, strongly typed programming language. It runs on billions of devices — Android apps, banking systems, e-commerce backends, and large enterprise software.
Intro — what is Java?
Java is a popular, strongly typed programming language. It runs on billions of devices — Android apps, banking systems, e-commerce backends, and large enterprise software.
Java follows the idea: write once, run anywhere. You compile source code to bytecode, and the JVM (Java Virtual Machine) runs it on Windows, Mac, or Linux.
Real-life example: Java is like a universal power adapter. You write your program once, and the JVM plugs it into any computer without rewriting for each OS.
- Object-oriented — organize code with classes and objects
- Huge ecosystem — Spring, Android, Hadoop, and more
- Strong typing — catches many mistakes at compile time
Get Started — install JDK and first program
To run Java you need the JDK (Java Development Kit). It includes javac (compiler) and java (runner). Download from Oracle or use OpenJDK.
Create a file Main.java, compile with javac Main.java, run with java Main. Every Java app needs a class with public static void main.
Real-life example: JDK is your kitchen with stove and tools. javac cooks the recipe (source) into a ready meal (bytecode). java serves it to the guest (JVM).
public class Main {
public static void main(String[] args) {
System.out.println("Hello, Rishtaara!");
}
}javac Main.java
java Main