Java is a high-level, object-oriented programming language developed by Sun Microsystems (now owned by Oracle).
Thank you for reading this post, don't forget to subscribe!- It was designed to be platform-independent, secure, and simple to use. Java enables developers to write code once and run it anywhere due to its “write once, run anywhere” (WORA) capability.
Short History of Java:
- 1991: Java project initiated by James Gosling and his team at Sun Microsystems, originally called Oak.
- 1995: Oak was renamed to Java, and the first public version Java 1.0 was released.
- 1998: Java 2 (J2SE) introduced improved performance and APIs.
- 2006: Sun made Java open-source through the OpenJDK project.
- 2010: Oracle acquired Sun Microsystems and took over Java development.
- Present: Java continues to evolve with regular version updates (e.g., Java 8, Java 11, Java 17, Java 21, etc.).
Java Buzzwords:
These are key features and design principles of Java:
- Simple: Easy to learn and use.
- Object-Oriented: Based on objects and classes.
- Distributed: Supports distributed computing using RMI and EJB.
- Interpreted: Uses an interpreter (JVM) to execute bytecode.
- Robust: Strong memory management and exception handling.
- Secure: Includes security features like bytecode verification.
- Architecture-Neutral: Can run on any platform with a JVM.
- Portable: Code is platform-independent.
- High Performance: Just-In-Time (JIT) compiler improves performance.
- Multithreaded: Supports multiple threads of execution.
- Dynamic: Adapts to evolving environments, loads classes at runtime.
Java Virtual Machine (JVM):
The JVM is a part of the Java Runtime Environment (JRE) that executes Java bytecode.
- It acts as an interpreter and compiler, converting bytecode into machine code for the host system.
- It ensures Java’s platform independence and manages memory and other resources.
Key roles of the JVM:
- Loads bytecode.
- Verifies code.
- Executes it.
- Provides runtime environment (memory management, garbage collection, etc.).
Java Runtime Environment (JRE):
The JRE provides the environment required to run Java applications. It includes:
- JVM.
- Core Java libraries.
- Other supporting files.
The JRE does not include development tools like compilers. It’s meant for users who only want to run Java applications, not develop them.
Bytecode:
Bytecode is the intermediate code generated by the Java compiler (javac) after compiling a .java source file. The resulting .class file contains platform-independent bytecode.
Bytecode is:
- Executed by the JVM.
- Platform-independent.
- Helps achieve Java’s WORA capability.