DEV Community

VINOTH
VINOTH

Posted on Edited on

Java Introduction

Java is one of the most popular and widely used programming languages in the world. It is a high-level, object-oriented programming language that is used to build different types of applications such as web applications, desktop applications, mobile applications, enterprise software, and backend systems.

  • Java is a platform-independent language, which means code written in Java can run on any device that supports the Java Virtual Machine (JVM).
  • Syntax and structure are similar to C-based languages like C++ and C#.

What is Java?

Java is a programming language developed by Sun Microsystems in 1995. It was originally created by James Gosling and his team.

One of the most important features of Java is:

"Write Once, Run Anywhere."
Enter fullscreen mode Exit fullscreen mode

This means that Java code can run on different operating systems as long as the system has a Java Virtual Machine (JVM).

Features of Java

Java has several important features:

1.Simple

Java syntax is relatively easy to understand, especially for developers who already know programming concepts.

2.Object-Oriented

Java follows the Object-Oriented Programming (OOP) approach.

The major OOP concepts are:

  • Class
  • Object
  • Inheritance
  • Polymorphism
  • Encapsulation
  • Abstraction

3.Platform Independent

Java source code is compiled into bytecode.

This bytecode can run on any system that has a JVM.

The basic flow is:

Java Code → Compiler → Bytecode → JVM → Output

4.Secure

Java provides several security features such as bytecode verification and controlled memory access.

5.Robust

Java has features such as strong type checking, exception handling, and automatic memory management, which help developers build reliable applications.

6.Multithreaded

Java supports multithreading, which allows multiple tasks to execute concurrently within a program.

How Does Java Work?

class Hello {
 public static void main(String[] args) { 
System.out.println("Hello, Java!"); 
}
 }
Enter fullscreen mode Exit fullscreen mode
The Java compiler converts this source code into bytecode.

Hello.java
    ↓
Java Compiler (javac)
    ↓
Hello.class
    ↓
Bytecode
    ↓
JVM
    ↓
Output
Enter fullscreen mode Exit fullscreen mode

JVM – Java Virtual Machine

JVM is responsible for executing Java bytecode.

JRE – Java Runtime Environment

JRE provides the environment required to run Java applications. It includes the JVM and required runtime libraries.

JDK – Java Development Kit

JDK is used to develop Java applications.

It includes tools such as the Java compiler along with the runtime environment.

The relationship can be understood as:

JDK → JRE → JVM
Enter fullscreen mode Exit fullscreen mode

Top comments (0)