Java is a high-level, object-oriented programming language developed by Sun Microsystems. It is widely used for building desktop applications, web applications, mobile apps, and enterprise systems. Java follows the principle of Write Once, Run Anywhere.
Java programs are written using classes and methods. Every Java program must have at least one class and a main method.
// Basic structure of a Java program
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, Java!");
}
}
Hello, Java!
The System.out.println statement prints text to the console. The program execution starts from the main method.
Enter values below to simulate how Java handles basic variables and output.