DEV Community

Cover image for INTRODUTION OF Java
Keerthana M
Keerthana M

Posted on

INTRODUTION OF Java

INTRODUTION OF Java:

  • Java is an High level programming language.
  • Java is also known as compiler programming language.
  • It is Statically data type(stric conditons)

    When java was invented?

  • The project began in June 1991,The language was initially called "Oak".

  • It was later renamed to "Java" in 1995.Java was designed by James Gosling at Sun Microsystems.

  • Java 1.0, was released on January 23, 1996.
    Java SE 17: Released on September 14, 2021.(latest version of java)

why java?

  • In C++ the programming was difficult in multiple platforms, And it has platform dependency.
  • To over come this situation, Java has been invented. Java is know for faster efficiency.

JAVA ARCHITECTURE:

JDK (Java Development Kit) is the complete package for Java development. It includes:

JRE (Java Runtime Environment)

  • Development tools like javac (compiler), javadoc, jar, and debuggers. Developers use JDK to write, compile, and debug Java programs.
  • It is platform-dependent, with separate builds for Windows, Linux, and macOS.

JRE (Java Runtime Environment) is meant for running Java applications. It contains:

JVM (Java Virtual Machine)

  • Core libraries and supporting files. It cannot compile code; it only provides the runtime environment to execute precompiled bytecode.
  • JVM (Java Virtual Machine) is the execution engine that converts Java bytecode into machine-specific instructions. Key responsibilities:
  1. Class loading (via ClassLoader)
  2. Bytecode verification for security
  3. Execution (interpretation or JIT compilation)

Memory management and garbage collection JVM is platform-dependent in implementation but executes platform-independent bytecode.

JIT (Just-In-Time Compiler) is a component of the JVM designed to improve performance.

  • Instead of interpreting all bytecode, JIT compiles frequently used bytecode sequences into native machine code at runtime, caching them for reuse. Optimizations include:

  • Register allocation

  • Eliminating redundant expressions

  • Reducing memory access This results in faster execution while maintaining JVM’s portability and safety.

How to create and execute java file:

Example:

public class Home{

public static void main( String args[]){
     System.out.println("hello");
 }
}
Enter fullscreen mode Exit fullscreen mode

OUTPUT:

hello

Top comments (0)