Lesson 2
Features of Java
The core features that define Java as a modern programming language.
Lesson content
Features of Java
1. Simple
Java is easy to learn and its syntax is clean and easy to understand. The confusing and ambiguous concepts of C++ are either left out or reimplemented more cleanly.
- Pointers are not part of Java.
- Operator overloading is not part of Java.
These choices make Java simpler for beginners while still staying powerful for real projects.
2. Object Oriented
In Java, everything is built around objects that have data and behavior. Java can be extended easily because it is based on the object model.
- Object
- Class
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation
3. Robust
Java reduces error-prone code through compile-time and runtime checking. It improves memory management and exception handling with automatic garbage collection and structured exception support.
4. Platform Independent
- Java programs compile to bytecode, not platform-specific machine code.
- The bytecode is stored in .class files.
- The JVM interprets bytecode on any system that has a native JVM.
- This is what makes Java a write once, run anywhere language.
5. Secure
Java runs in the Java runtime environment with very limited interaction with the operating system, which makes it a strong choice for secure applications.
6. Multi-Threading
Java multithreading makes it possible to run multiple tasks at the same time while sharing memory and resources efficiently.
7. Architectural Neutral
Java bytecode has nothing to do with a particular computer architecture, so it is easy to interpret on different machines.
8. Portable
Java bytecode can move from one platform to another without implementation-dependent features getting in the way. Even primitive data sizes are predefined.
9. High Performance
Java uses just-in-time compilers to improve performance, even though it is interpreted through the JVM.
10. Distributed
- Java programs can be designed to run on computer networks.
- Java has a special class library for communicating using TCP/IP protocols.
- Creating network connections is easier in Java than in C or C++.