Java SE (Standard Edition) is the core and foundation of the Java platform. It provides the basic libraries, tools, and APIs required to build desktop applications, console programs, and core Java-based systems.
Java SE includes everything needed to write, compile, and run basic Java programs. Programs are compiled into bytecode using the Java compiler (javac) and executed by the Java Virtual Machine (JVM).
// Basic Java SE program structure
public class Main {
public static void main(String[] args) {
System.out.println("Hello from Java SE");
}
}
The program starts execution from the main method. The JVM loads the class, and the System.out.println statement prints the message to the console.
// Using Java SE standard library (java.util)
import java.util.Date;
public class Demo {
public static void main(String[] args) {
Date today = new Date();
System.out.println(today);
}
}
This example demonstrates the use of a built-in Java SE class. The Date class is part of the standard Java library and provides date and time functionality.
Scanner class to take user input