Java Quick Revision Notes - Part 1 & 2
■ 1. What is Java?
■ Concept
- Java is a high-level, class-based, object-oriented programming language.
- Developed by James Gosling at Sun Microsystems in 1995.
- Known for platform independence → "Write Once, Run Anywhere (WORA)".
- Runs using JVM (Java Virtual Machine) which executes bytecode.
■ Important Rules / Exceptions
1. Java is case-sensitive (main ≠ Main).
2. The file name must match the public class name.
3. Only one public class allowed per .java file.
4. main method signature must be:
public static void main(String[] args)
- args can have any name, but String[] type is mandatory.
5. Without main, Java program won’t run (except JShell or static block before Java 7).
■ Interview Questions
- Why is Java called platform independent?
- Difference between JDK, JRE, JVM?
- Can we run a Java program without main() method?
- Why is main() method public static void?
- Is Java 100% Object-Oriented?
■■ Example
class HelloJava {
public static void main(String[] args) {
System.out.println("Hello Java!");
}
}
■ Tips to Remember
- Java = OOP + Platform Independent + Secure + Robust.
- Keywords like goto & const are reserved in Java but not used.
- Always think of Java as a language + platform (JVM).
■ 2. History of Java
■ Concept
- 1991 → Project started by James Gosling & team at Sun Microsystems (called Oak).
- 1995 → Officially released as Java (since Oak was trademarked).
- Designed for embedded systems, interactive TV, later adapted for internet applications.
- 1996 → First JDK (Java Development Kit 1.0).
- 2009 → Oracle acquired Sun Microsystems → Java under Oracle.
- Today → widely used in Enterprise, Android, Microservices, Big Data, Cloud.
■ Important Rules / Exceptions
- Java versioning follows major releases (Java SE 8, 11, 17, 21 are LTS).
- Backward compatibility → Old Java code usually works in newer versions.
- Applets & Java Web Start deprecated & removed in Java 11+.
■ Interview Questions
- Who is the father of Java?
- Why was Java initially named Oak?
- What was Java’s original purpose?
- Which company owns Java now?
- Which Java versions are LTS?
■■ Example (Timeline)
1995 → Java 1.0
2004 → Java 5 (Generics, Annotations)
2011 → Java 7 (try-with-resources, switch on String)
2014 → Java 8 (Lambdas, Streams, Default Methods)
2017 → Java 9 (Modules)
2018 → Java 11 (LTS, Removed Applets, JavaFX out)
2021 → Java 17 (LTS, Sealed classes, Pattern Matching)
2023 → Java 21 (LTS, Virtual Threads)
■ Tips to Remember
- Java’s slogan: "Write Once, Run Anywhere."
- Always know Java 8, 11, 17, 21 → most used in industry.
- Interviewers often ask what changed in latest LTS version.