What is Java?

Last Updated : July 24, 2025

Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. It was developed by Sun Microsystems and released in 1995. Java is known for its portability, robustness, and ease of use, making it one of the most popular programming languages worldwide.

Key Features of Java

Java has several powerful features that make it suitable for a wide range of applications:

  • Object-Oriented: Everything in Java is treated as an object, which helps in building modular and reusable code.
  • Platform Independent: Java code is compiled into bytecode that runs on the Java Virtual Machine (JVM), making it platform-independent.
  • Robust and Secure: Java includes strong memory management and built-in security features.
  • Multithreaded: Java supports multithreading, allowing concurrent execution of two or more threads.
  • Rich API: Java provides a wide range of libraries and frameworks for various functionalities.

Java Program Structure

A basic Java program contains a class, and the execution starts from the main method.

Example

The following example demonstrates a simple Java program that prints a message:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, Java!");
    }
}

When you run the above code, the output will be:

Hello, Java!

Here,

  • HelloWorld is the class name.
  • main is the entry point of any Java application.
  • System.out.println is used to print messages to the console.

Java Compilation and Execution

Java source code (.java files) is compiled by the Java Compiler (javac) into bytecode (.class files), which is then executed by the JVM.

Example

Steps to compile and run a Java program from the command line:

javac HelloWorld.java
java HelloWorld

This will output:

Hello, Java!

Java Applications

Java is widely used in various types of applications, including:

  • Web applications (using frameworks like Spring, JSP, Servlets)
  • Mobile applications (Android development)
  • Desktop GUI applications
  • Enterprise systems
  • Game development
  • Big data and cloud-based solutions

Exercise

Select the correct option to complete each statement about Java.

  1. Java code is executed by the:
  2. In Java, the method where program execution begins is:
  3. Java code is first compiled into:

Advertisement
Advertisement

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.