Nearby lessons
3 of 125Java - Features of Java
📌 What You Will Learn
- What Java is and why it is so popular
- The history and different versions of Java
- The important features of Java
- How Java is platform independent (Write Once, Run Anywhere)
- The difference between JDK, JRE and JVM
- How Java is different from C and C++
Features of Java is a core concept of the Java language. This lesson explains Important Features of Java and How Java is Platform Independent (WORA) with complete, runnable code examples, clear step-by-step explanations, and common mistakes to avoid with exam-style MCQs at the end.
Important Features of Java
Java became famous because of these features. A good student should know every feature with a one-line meaning:
| Feature | What it means in simple words |
|---|---|
| Simple | Java is easy to learn. It removed confusing parts of C/C++ like pointers and multiple inheritance. |
| Object Oriented | Java organises the program around objects (real world things) and classes (blueprints). |
| Platform Independent | Same program runs on any operating system — Write Once, Run Anywhere (WORA). |
| Robust | Java is strong and does not break easily. It gives automatic memory management and strong error checking. |
| Secure | Java has built-in security. Code runs inside a protected area called the JVM sandbox. |
| Portable | Same bytecode works everywhere, so the program can move easily from one machine to another. |
| Dynamic | Java can load classes at run time, so programs can grow and change even while running. |
| Multithreaded | Java can do many tasks at the same time inside one program, like downloading and typing together. |
| High Performance | Java uses Just-In-Time (JIT) compilation which makes it quite fast. |
| Distributed | Java has strong networking support, so programs on different computers can talk to each other. |
| Architecture Neutral | The bytecode is designed to run on any processor, so Java does not depend on one type of hardware. |
How Java is Platform Independent (WORA)
This is the most important concept in Java. Let us understand it with a simple story:
- You write the program in a file called Hello.java. This is the source code. It is human readable.
- You run a command javac Hello.java. The compiler converts your source code into a special file called Hello.class. This file contains bytecode. Bytecode is not machine language — it is a middle step.
- Now this .class file can go to any computer — Windows, Linux or Mac. On each computer, the JVM (Java Virtual Machine) reads the bytecode and converts it into that computer's machine language.
- So the program is written once, but it runs anywhere. That is why we say Write Once, Run Anywhere (WORA).
The special thing is: the .class file is the same everywhere. Only the JVM is different for each operating system. Windows has its own JVM, Linux has its own JVM. Java makes a program independent, but the JVM itself is dependent on the operating system.
In simple words: Bytecode is a middle step between your source code and machine code. The same .class file runs on every computer because each operating system has its own JVM to convert that bytecode.
Example02
📝 Key Takeaways
- Java is a simple, secure, object-oriented programming language created by James Gosling at Sun Microsystems (now Oracle).
- Write Once, Run Anywhere (WORA): source code (.java) is compiled to bytecode (.class), and every JVM runs that same bytecode.
- JDK > JRE > JVM. JDK is for developers, JRE is for running, JVM executes bytecode.
- Important versions: Java 8 (LTS), Java 11 (LTS), Java 17 (LTS), Java 21 (LTS).
- Java is different from C/C++ because it has no pointers, automatic memory management, and is platform independent.
🧠 Test Your Knowledge
2 QuestionsProgress: 0 / 2