Description #
Java is a powerful, object-oriented programming language designed for cross-platform compatibility, scalability, and security. Known for its “write once, run anywhere” (WORA) principle, Java is used in web applications, Android development, enterprise systems, and large-scale backend infrastructures.
History #
Java was developed by James Gosling and his team at Sun Microsystems in the early 1990s. Originally called Oak, it was renamed Java in 1995 after discovering the name Oak was already trademarked. The language quickly became popular due to its simplicity, robustness, and platform independence powered by the Java Virtual Machine (JVM).
Key milestones in Java’s evolution include:
- Java 1.0 (1996) – first public release
- Java 2 (1998) – added Swing, Collections Framework
- Java 5 (2004) – introduced generics, enums, annotations
- Java 8 (2014) – added lambda expressions and streams
- Java 17 (2021) – current LTS (Long-Term Support) version as of now
After Oracle acquired Sun Microsystems in 2010, Java’s stewardship shifted, and today it is maintained by Oracle and the OpenJDK community.
Hello World Code #
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
How to Run #
Save the file as HelloWorld.java
(must match the class name)
Compile the file using:
javac HelloWorld.java
Run the compiled class:
java HelloWorld
📝 Make sure Java is installed and configured in your system PATH.
Key Concepts #
public class
— defines the class structure
main()
— entry point for execution
System.out.println()
— prints output to the console
Strongly typed — variables must be declared with types
Object-oriented — uses classes, inheritance, encapsulation
Compiles to bytecode — runs on the JVM
Cross-platform — WORA via JVM
Garbage collection — automatic memory management
Static typing — helps catch errors at compile time
Exception handling — robust try-catch error control
Try It Online #
🔗 JDoodle – Java Compiler
🔗 Replit – Java
🔗 OneCompiler – Java
Fun Facts #
The name “Java” came from coffee beans from Java Island
Android apps were originally written in Java
Java is used by NASA, Netflix, Uber, and major banks
The Java mascot is a steaming coffee cup named “Duke”
Java powers over 3 billion devices worldwide