Day 1: Java Fundamentals
1. Introduction to Java & Its Features
Java is a high-level, object-oriented, platform-independent programming language
developed by James Gosling at Sun Microsystems in 1995.
Key features:
Platform Independent – "Write Once, Run Anywhere" (WORA)
Object-Oriented – Everything in Java is based on objects and classes.
Secure – Java provides strong security mechanisms.
Robust – Java has strong memory management and exception handling.
Multithreading – Supports multiple threads for better performance.
2. Java Virtual Machine (JVM) - How It Works
JVM is the heart of Java, responsible for running Java programs.
It converts Java bytecode into machine code so that the program can run on any OS.
3. Setting Up Java Environment (JDK, JRE, JVM)
JDK (Java Development Kit): Contains everything to develop and run Java programs.
JRE (Java Runtime Environment): Needed to run Java applications.
JVM (Java Virtual Machine): Converts bytecode to machine code.
🔹 Installation Steps:
1. Download JDK from Oracle or OpenJDK.
2. Install and set up the JAVA_HOME path.
3. Verify installation using:
4. sh
5. CopyEdit
6. java -version
7. javac -version
4. Writing First Java Program - "Hello, World!"
public class HelloWorld – Defines the class.
public static void main(String[] args) – The entry point of a Java program.
System.out.println("Hello, World!"); – Prints output to the console.
5. Best IDEs for Java Development
Eclipse – Popular open-source Java IDE.
IntelliJ IDEA – Advanced features with great performance.
VS Code – Lightweight and supports Java extensions.
NetBeans – Good for beginners.