Features of Java
Java is defined by a set of carefully chosen features that distinguish it from languages that came before it. Sun Microsystems originally documented these ...
Core Characteristics That Define Java
Java is defined by a set of carefully chosen features that distinguish it from languages that came before it. Sun Microsystems originally documented these features in a white paper using eleven descriptive terms, and understanding each one helps you grasp why Java became so dominant in enterprise software development.
Simple: Java was deliberately designed to be easier to learn than C++. It eliminated confusing features such as explicit pointer arithmetic, operator overloading, and multiple inheritance of classes. Memory management is handled automatically by the garbage collector, so developers do not need to call free() or delete on objects they no longer need.
Object-Oriented: Everything in Java, except primitive types, is an object. Programs are built from classes that encapsulate data and behavior. The four pillars of object-oriented programming — encapsulation, inheritance, polymorphism, and abstraction — are all supported by the language.
Platform Independent: The bytecode compiled from Java source code is not tied to any specific processor or operating system. The JVM translates bytecode to native instructions at runtime, enabling the same .class file to execute on Windows, Linux, or macOS without modification.
Robust: Java enforces strong compile-time type checking, provides runtime exception handling, and performs automatic array bounds checking. These features reduce the likelihood of crashes and undefined behavior that plague lower-level languages.
Secure: Java runs inside the JVM sandbox, which restricts access to system resources. The language has no pointer arithmetic, which eliminates entire classes of memory corruption vulnerabilities. The class loader and bytecode verifier add additional layers of security before any code executes.
Multithreaded: Java includes built-in support for concurrent programming through the Thread class and the java.util.concurrent package. The synchronized keyword and various lock mechanisms allow safe sharing of data between threads.
High Performance: While interpreted bytecode is slower than native code, the Just-In-Time (JIT) compiler in modern JVMs compiles frequently executed bytecode paths into native machine code at runtime, closing much of the performance gap.
Exam tip: Interviewers often ask candidates to list Java's features and explain one in depth. Choose "platform independence" and explain the role of bytecode and the JVM, since this is Java's most iconic and frequently tested characteristic.