DEV Community

Pavithraarunachalam
Pavithraarunachalam

Posted on

Introduction to java..

what is java?

Java is a high-level, object-oriented programming language used to build web apps, mobile applications, and enterprise software systems. It is known for its Write Once, Run Anywhere capability, which means code written in Java can run on any device that supports the Java Virtual Machine (JVM).

Features of java:

1.Platform independence:
java's bytecode can be executed on any platform with the application JVM.

2.Object oriented:
Everything is treated as an object (real-world style).Helps organize and reuse code.

3.Simple:
Java's syntax is inspired by c++ and c.
4.Robust and secure:
Java has feature like memory management,strong type checking,and exception handling to ensure to bust ans secure programs

5.Multithreading:
Can do many tasks at once (like downloading and playing music together).Uses threads easily.
6.Dynamic:
Java supports dynamic memory allocation and garbage collection,simplifying memory management.

7.High performance:
Fast enough with Just-In-Time (JIT) compiler Slower than C++, but optimized for many tasks.

Java Architecture

  1. Java Source Code
    You write your Java program in plain text files with .java extension.

  2. Java Compiler
    The Java compiler (javac) converts your .java files into bytecode (.class files).
    Bytecode is a kind of machine language, but it’s not for any specific computer — it’s for the Java Virtual Machine (JVM).

  3. Java Virtual Machine (JVM)
    The JVM reads and runs the bytecode.
    It acts like a translator between the bytecode and your computer’s actual hardware.
    This is why Java programs can run on any device that has a JVM — this is called "Write Once, Run Anywhere".

  4. Java Runtime Environment (JRE)
    The JRE includes the JVM plus some libraries and tools to run Java programs.
    If you only want to run Java programs (not write or compile), you need the JRE.

  5. Java Development Kit (JDK)
    The JDK includes the JRE plus tools to write and compile Java code (like the compiler and debugger).
    Developers use the JDK to create Java programs.


Top comments (0)