What are the main features of Java?
Java is a class-based, statically-typed, object-oriented language whose key promise is "write once, run anywhere" — source compiles to bytecode that runs on the JVM on any OS.
Platform independence — bytecode runs on any JVM (Windows, Linux, macOS).
Object-oriented — encapsulation, inheritance, and polymorphism with single class inheritance.
Strongly & statically typed — type errors caught at compile time; generics are enforced.
Automatic memory management — the garbage collector reclaims unused objects.
Multi-threaded — built-in
Threadandjava.util.concurrentAPIs.Secure & robust — sandboxed execution, no pointer arithmetic, strict exception handling.
Rich ecosystem — massive standard library plus Spring, Hibernate, Maven/Gradle.
Beyond listing features, explain why each matters practically. Platform independence enables enterprise deployment across environments.
Strong typing catches bugs at compile time. Garbage collection prevents memory leaks.