Java Programs
567 Java programs, from your first Hello World to thread-safe caches. Every program comes with complete code, its exact output, a step-by-step explanation and often a second way to solve it — and you can run each one online without installing anything. Pick a topic below, or start with the programs interviewers ask most.
Most Popular Programs
Java Program Topics
Strings
Reverse, palindrome, anagram and more.
View Programs →🔢Arrays
Array searching, sorting and more.
View Programs →🧮Numbers
Prime, palindrome, Armstrong numbers and more.
View Programs →🔄Control Flow
Loops, conditions and switch.
View Programs →🔺Patterns
Star, number and pyramid patterns.
View Programs →👋Basics & I/O
Syntax, variables and console input.
View Programs →🧱OOP
Classes, inheritance and interfaces.
View Programs →⚠️Exceptions
Try, catch and custom exceptions.
View Programs →📦Collections
ArrayList, HashMap and the framework.
View Programs →🌀Recursion
Factorial, Fibonacci and more.
View Programs →🌊Java 8 Streams
filter, map, groupingBy and collectors.
View Programs →🧵Multithreading
Threads, executors and synchronization.
View Programs →📁File Handling
Read, write, copy and list files.
View Programs →📅Date & Time
Format, parse and compare dates.
View Programs →