Java is a high-level, object-oriented programming language developed to be portable, secure, and easy to use. It follows the principle "Write Once, Run Anywhere", meaning Java programs can run on any system that has a Java Virtual Machine (JVM).
Initially, Java was designed for embedded systems and interactive television. The project was named Green, and the language was first called Oak, named after an oak tree outside Gosling's office. Later, it was renamed Java, inspired by Java coffee.
// This is the first basic Java program demonstrating history example
class HistoryDemo {
public static void main(String[] args) {
System.out.println("Java was released in 1995");
}
}
The program prints a simple message showing Java’s first release year. This demonstrates how Java programs start execution from the main() method.