A
A
o In June 1991, James Gosling and his team at Sun Microsystems embarked on
creating a new language. Initially called Oak, it aimed to enable communication
among consumer electronic devices.
o However, the focus shifted to a new niche: the World Wide Web. The team
recognized the potential of Oak for web programming.
o In May 1995, Sun Microsystems officially released Java as a core component of its
Java platform.
o The language was designed with the vision of “write once, run anywhere” (WORA).
This meant that compiled Java code could run on any platform supporting Java
without recompilation.
3. Key Milestones:
o 2004: Java 5 (J2SE 5.0) introduced generics, metadata, and other features.
o 2021: Java 17 (LTS version) brought pattern matching and sealed classes.
o OpenJDK became the default JVM (Java Virtual Machine) for most developers and
Linux distributions.
o Java gained immense popularity after its release and remained a top programming
language.
o However, in recent years, other languages using the JVM have gained traction,
leading to a gradual decline in Java’s use.
Anatomy of Java?
1. Documentation Section:
o Optional but valuable.
o Contains basic information about the program (author, creation date, version,
description).
2. Package Declaration:
3. Import Statements:
4. Class Definition:
Reference Types:
Non-primitive data types are often called reference types because they refer to objects.
Nullability:
A primitive type always has a value (even if it’s the default value like 0 or false).
Method Invocation:
Naming Convention: