Learn Java with
runnable examples.
Clear explanations, complete source code and sample output — from your first program to OOP, collections, threads and data structures.
223+
Programs
6
Tracks
21
Topics
JDK
Platform
Popular Programs
Default Access Specifier Example in Java
Learn Default Access Specifier in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Simple Array Example in Java
Learn Simple array in Java with explanation, complete source code, step-by-step walkthrough and sample output.
My First Java Example in Java
Learn My First in Java with explanation, complete source code, step-by-step walkthrough and sample output.
If Example in Java
Learn If in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Area of Circle Example in Java
Learn Area Of Circle in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Celsius to Fahrenheit Example in Java
Learn Celsius To Fahrenheit in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Int Datatype Example in Java
Learn Int Datatype in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Simple Queue Example in Java
Learn Simple Queue in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Exception Handling Example in Java
Learn Exception Handling in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Linked List Example in Java
Learn Linked List in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Learning track
Java Basics
Start with your first Java program, data types, variables and operators — each topic includes runnable code and sample output.
Basic Programs
First programs, constructors, methods and simple class examples.
21 tutorialsData Type Programs
byte, short, int, long, float, double, char and boolean examples.
8 tutorialsVariable Programs
Local, instance and static variables with clear examples.
2 tutorialsOperator Programs
Arithmetic, relational, logical, assignment and increment/decrement operators.
20 tutorialsLearning track
Conditional
Control flow with if/else, switch, loops, jump statements and Java access specifiers.
Access Specifier Programs
public, private, protected and default access in Java classes.
4 tutorialsConditional Statement Programs
if, if-else, if-else-if, switch and ternary operator examples.
5 tutorialsLoop Programs
for, while, do-while, enhanced for and nested loop examples.
5 tutorialsJump Statement Programs
break, continue and return with practical examples.
2 tutorialsLearning track
Array and String
Work with arrays and strings — creation, traversal, manipulation and common utilities.
Learning track
OOPS
Object-oriented Java — inheritance, polymorphism, interfaces, exceptions, collections, threads and I/O.
OOPS Programs
Classes, objects, inheritance, polymorphism, encapsulation and abstraction.
10 tutorialsException Handling Programs
try-catch-finally, throw, throws, custom exceptions and common runtime errors.
19 tutorialsJava Collection Programs
ArrayList, HashMap, HashSet, TreeMap, Queue and related collection APIs.
23 tutorialsThread Programs
Thread creation, sleep, wait/notify and deadlock examples.
3 tutorialsJava Files And Input Output Programs
Readers, writers, streams and file handling in Java.
7 tutorialsLearning track
Miscellaneous
Patterns, conversions, calculations and assorted useful Java programs.
Miscellaneous Programs
Prime numbers, factorial, palindrome, GCD, LCM and more.
9 tutorialsPattern Programs
Triangles, Floyd's triangle, Pascal triangle and star patterns.
9 tutorialsConversion Programs
Temperature, case, string/array conversions and date formatting.
4 tutorialsCalculation Programs
Area, circumference, averages and numeric calculations.
27 tutorialsLearning track
Data Structure
Stacks, queues, linked lists, searching and sorting algorithms in Java.
Network
More learning sites
Explore tutorials on the main hub and dedicated language subdomains.