Java is a high-level, class-based, object-oriented programming language designed by James Gosling at Sun Microsystems in 1995. Its defining philosophy is "Write Once, Run Anywhere" (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.
As of early 2026, Java remains a powerhouse in enterprise software, Android development, and cloud-native applications, with Java 25 LTS (released late 2025) being the current standard for modern development.
Java’s portability is achieved through a unique execution process:
JDK (Java Development Kit): The full software environment used to develop Java applications. It includes the JRE and development tools (like the compiler javac).
JRE (Java Runtime Environment): The package that allows a computer to run Java applications. It includes the JVM and core libraries.
JVM (Java Virtual Machine): The engine that executes Java bytecode. This bytecode is an intermediate, platform-neutral format that the JVM translates into machine-specific code at runtime.
Java's longevity is due to several "buzzword" features that make it reliable:
Object-Oriented (OOP): Everything in Java is an Object. It follows four main principles: Inheritance, Encapsulation, Abstraction, and Polymorphism.
Platform Independent: Because it runs on the JVM, it is not tied to a specific operating system.
Robust & Secure: It features strong memory management (Garbage Collection), exception handling, and a "sandbox" environment that prevents untrusted code from accessing the host system.
Multithreading: Java supports concurrent execution of two or more parts of a program for maximum utilization of CPU. Modern Java (Project Loom) has introduced Virtual Threads, allowing millions of concurrent tasks with minimal overhead.
Spring Boot 4: The dominant framework for building microservices and web APIs.
Cloud-Native: Increased focus on Project Leyden for faster startup times (AOT compilation) and Project Valhalla for better memory performance through value types.
AI Integration: Java has become "AI-ready" with libraries like Spring AI, making it easier to integrate Large Language Models (LLMs) into enterprise apps.
Java Programming for Beginners This video provides a comprehensive introduction to Java syntax and the "Write Once, Run Anywhere" philosophy, which is perfect for understanding the basics mentioned above.
import java.util.Scanner;
import java.awt.print.*;
import java.awt.*;
public class MultiplyAndPrint {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// 1. Accept 2 numeric inputs
System.out.print("Enter first number: ");
double num1 = scanner.nextDouble();
System.out.print("Enter second number: ");
double num2 = scanner.nextDouble();
// 2. Store and multiply
double result = num1 * num2;
// 3. Output to display screen
String output = "The result of " + num1 + " x " + num2 + " = " + result;
System.out.println("\n--- Display Output ---");
System.out.println(output);
// 4. Output to printer
System.out.println("\nSending to printer...");
printText(output);
scanner.close();
}
/**
* Sends a string to the system's default printer
*/
public static void printText(String text) {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable((Graphics graphics, PageFormat pageFormat, int pageIndex) -> {
if (pageIndex > 0) {
return Printable.NO_SUCH_PAGE;
}
// Set up the drawing area
Graphics2D g2d = (Graphics2D) graphics;
g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
g2d.setFont(new Font("Serif", Font.PLAIN, 12));
// Draw the text on the "virtual" page
graphics.drawString(text, 100, 100);
return Printable.PAGE_EXISTS;
});
boolean doPrint = job.printDialog();
if (doPrint) {
try {
job.print();
System.out.println("Print job successful.");
} catch (PrinterException e) {
System.err.println("Error: Could not print. " + e.getMessage());
}
}
}
}