SrcForge Java Tutorial Hub
Learn Java through focused lessons, one topic at a time.
Start with the basics and move through syntax, data types, object-oriented programming, statements, and practice questions in a clean tutorial flow.
Navigation
Use the lesson cards below to jump directly into any topic.
Java course enrollment
Enroll to save your Java progress.
Track completed lessons, resume from your dashboard, and keep your Java course progress synced to your account.
61 trackable lessons
Lessons
Choose a lesson to start learning
Foundation
Getting Started with Java
What Java is, why it's popular, and how to write, compile and run your first program.
Lesson 1
What is Java?
Learn what Java is, its origin, WORA, major applications and how to install and run your first Java program on Windows.
Open lessonLesson 2
Features of Java
Learn why Java is popular, what its core features mean and how those features power reliable, scalable applications.
Open lessonSyntax Basics
The building blocks of Java source code: keywords, identifiers, tokens and data types.
Lesson 3
Keywords
Learn Java keywords, their meaning and why reserved words cannot be used as identifiers or variable names.
Open lessonLesson 4
Tokens
Learn Java tokens, keywords, identifiers, literals, operators, separators, comments and constants used in source code.
Open lessonLesson 5
Datatypes
Learn Java primitive and non-primitive data types, their sizes, ranges and common value examples for beginners.
Open lessonLesson 6
Type Casting
Beginner-friendly guide to Java type casting: implicit vs explicit, examples and FAQs.
Open lessonLesson 7
Wrapper Class
Learn Java Wrapper Class with examples. Understand boxing, unboxing, primitive types and wrapper objects in simple beginner-friendly language.
Open lessonOperators, Statements & Control Flow
Performing operations on data and controlling which code runs and when.
Lesson 8
Operators
Learn Java Operators with examples. Understand arithmetic, relational, logical, assignment, conditional and bitwise operators in Java.
Open lessonLesson 9
Java Statements
Learn what Java statements are, the main statement types and how command-line arguments work in a first Java program.
Open lessonLesson 10
Control Statements
Learn Control Statements in Java with examples. Understand if, if-else, else-if, nested if and switch statements in simple beginner-friendly language.
Open lessonLesson 11
Loops
Learn Loops in Java with examples. Understand for loop, while loop, do-while loop, enhanced for loop, break and continue statements easily.
Open lessonUser Input & Methods
Reading input with Scanner and organizing code into reusable methods.
Lesson 12
Expressions and Scanner Class
Learn Expressions and Scanner Class in Java with examples. Understand arithmetic, relational, logical expressions and how to take user input during program execution.
Open lessonLesson 13
Methods
Learn Methods in Java with examples. Understand method types, parameters, return types, recursion, scope and static methods in simple language.
Open lessonLesson 14
Constructors
Learn Constructors in Java with examples. Understand default, parameterized and copy constructors in simple beginner-friendly language.
Open lessonLesson 15
Modifiers
Learn Modifiers in Java with examples. Understand access modifiers, non-access modifiers, public, private, protected, final, static, abstract and more.
Open lessonArrays & Strings
Storing collections of data and working with text.
Lesson 16
Arrays
Learn Arrays in Java with examples. Understand one-dimensional arrays, multidimensional arrays, jagged arrays, sorting, searching and array operations.
Open lessonLesson 17
Strings and StringBuffer
Learn Java Strings, StringBuffer and StringBuilder with examples. Understand string methods, mutability, thread safety and performance differences.
Open lessonLesson 18
Regex (Regular Expressions)
Learn Java Regex (Regular Expressions) with examples. Understand Pattern, Matcher, character classes, quantifiers, metacharacters and string validation techniques.
Open lessonPackages & Code Organization
Structuring Java code into namespaces.
Intermediate
Object-Oriented Programming
The four pillars of OOP plus the Java mechanics that implement them.
Lesson 20
OOP Concepts
Learn OOP concepts in Java including Class, Object, Encapsulation, Abstraction, Polymorphism, Inheritance, Dynamic Binding and Message Passing with examples.
Open lessonLesson 21
Inheritance
Learn Inheritance in Java with examples of Single, Multilevel and Hierarchical Inheritance. Understand the extends keyword, superclass, subclass and code reusability.
Open lessonLesson 22
Abstraction
Learn Abstraction in Java with examples. Understand abstract classes, abstract methods, implementation hiding, OOP concepts, benefits and real-world use cases.
Open lessonLesson 23
Encapsulation
Learn Encapsulation in Java with examples. Understand data hiding, private variables, getter and setter methods, benefits and OOP principles for beginners.
Open lessonLesson 24
Polymorphism
Learn Polymorphism in Java with examples of method overloading, constructor overloading, method overriding, dynamic dispatch, upcasting and downcasting.
Open lessonLesson 25
Interface
Learn Interfaces in Java with examples. Understand abstraction, multiple inheritance, interface constants, implements keyword and interface vs abstract class.
Open lessonClasses In Depth
Inner classes, anonymous classes, the final keyword, singletons and the root Object class.
Lesson 26
Inner Classes, Static Members and Static Blocks
Learn Inner Classes, Static Variables, Static Methods and Static Blocks in Java with examples, syntax, outputs and FAQs for beginners.
Open lessonLesson 27
Anonymous Inner Class
Learn Java Anonymous Inner Class with syntax, examples, advantages, limitations and FAQs. Understand how anonymous classes simplify Java programming.
Open lessonLesson 28
Final Keyword
Learn the Java Final Keyword with examples of final variables, final methods and final classes. Understand syntax, rules, benefits and FAQs.
Open lessonLesson 29
Singleton Class
Learn Java Singleton Class with syntax, examples, advantages, implementation steps and FAQs. Understand the Singleton Design Pattern in Java.
Open lessonLesson 30
Object Class
Learn the Java Object Class with examples, methods and use cases. Understand equals(), hashCode(), toString(), getClass() and more.
Open lessonModern Java Features
Recursion, enums, generics, lambda expressions and the Stream API.
Lesson 31
Recursion
Learn Java recursion with simple examples. Understand recursive methods, base cases, factorial programs, advantages and best practices.
Open lessonLesson 32
Enumeration (Enum)
Learn Java Enumeration (Enum) with examples. Understand enum syntax, switch statements, values() method, advantages and best practices.
Open lessonLesson 33
Generics
Learn Java Generics with examples. Understand generic methods, type parameters, compile-time safety, advantages and best practices.
Open lessonLesson 34
Lambda Expressions
Learn Java Lambda Expressions with examples. Understand syntax, functional interfaces, advantages, use cases and best practices in Java 8+.
Open lessonLesson 35
Java Stream API
Learn Java Stream API with examples. Understand streams, filter, map, reduce, sorting, terminal operations and best practices in Java 8+.
Open lessonCollections Framework
Storing and managing groups of objects: lists, sets, maps and their sorted variants.
Lesson 36
Java Collections Framework
Learn Java Collections Framework with examples. Understand List, Set, Queue, Map, ArrayList, HashSet, HashMap and best practices.
Open lessonLesson 37
ArrayList and LinkedList
Learn Java ArrayList and LinkedList with examples. Compare features, performance, advantages, use cases and best practices in Java Collections.
Open lessonLesson 38
HashMap and HashSet
Learn Java HashMap and HashSet with examples. Understand key-value pairs, unique elements, differences, methods and best practices.
Open lessonLesson 39
TreeMap and TreeSet
Learn Java TreeMap and TreeSet with examples. Understand sorted collections, methods, differences, advantages and best practices in Java.
Open lessonException Handling
Handling runtime errors gracefully — required reading before I/O and concurrency.
Advanced
Java I/O & Data Handling
Working with dates, files, streams and saving objects to disk.
Lesson 54
Date and Time API
Learn Java Date and Time API with examples. Understand LocalDate, LocalTime, LocalDateTime, DateTimeFormatter, date formatting, and best practices.
Open lessonLesson 55
InputStream and OutputStream
Learn Java InputStream and OutputStream with examples. Understand FileInputStream, FileOutputStream, stream methods, file handling, and Java I/O best practices.
Open lessonLesson 56
Java File I/O (NIO)
Learn Java File I/O (NIO) with examples. Understand Path, Files, file handling, directory operations, NIO methods, and best practices for modern Java development.
Open lessonLesson 57
Serialization and Deserialization
Learn Java Serialization and Deserialization with examples. Understand Serializable, ObjectInputStream, ObjectOutputStream, transient fields, and object persistence.
Open lessonLesson 58
Transient Keyword
Learn the Java transient keyword with examples. Understand how transient works in serialization, why it is used, and what happens after deserialization.
Open lessonMultithreading & Concurrency
A deep, dedicated module on Java threads — life cycle, scheduling, pools, synchronization and deadlocks. Recommended after you're comfortable with everything above.
Lesson 40
Multithreading
Learn Java Multithreading with examples. Understand threads, Runnable, synchronization, thread lifecycle, advantages and best practices.
Open lessonLesson 41
Thread Life Cycle
Learn the Java Thread Life Cycle with examples. Understand New, Runnable, Waiting and Terminated states, thread transitions, synchronization and best practices.
Open lessonLesson 42
Thread Priority
Learn Java Thread Priority with examples. Understand MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY, scheduling, yield() and best practices.
Open lessonLesson 43
Thread Scheduler
Learn Java Thread Scheduler with examples. Understand thread scheduling, priorities, context switching, JVM scheduling and multithreading concepts.
Open lessonLesson 44
Thread sleep() Method
Learn the Java Thread sleep() method with examples. Understand syntax, thread states, InterruptedException, uses and best practices in multithreading.
Open lessonLesson 45
Thread join() Method
Learn the Java Thread join() method with examples. Understand thread coordination, waiting state, InterruptedException, syntax and best practices.
Open lessonLesson 46
Daemon Thread
Learn Java Daemon Threads with examples. Understand daemon vs user threads, JVM behavior, setDaemon(), uses, advantages and best practices.
Open lessonLesson 47
Thread Pool
Learn Java Thread Pool with ExecutorService examples. Understand thread reuse, Executors, task execution, benefits and multithreading best practices.
Open lessonLesson 48
ThreadGroup
Learn Java ThreadGroup with examples. Understand thread grouping, thread management, activeCount(), enumerate(), methods and best practices.
Open lessonLesson 49
Shutdown Hook
Learn Java Shutdown Hooks with examples. Understand addShutdownHook(), JVM shutdown process, cleanup tasks, resource management and best practices.
Open lessonLesson 50
Runtime Class
Learn the Java Runtime class with examples. Understand getRuntime(), memory management, exec(), garbage collection, shutdown hooks and JVM interaction.
Open lessonLesson 51
Synchronization
Learn Java Synchronization with examples. Understand synchronized methods, synchronized blocks, thread safety, race conditions, monitor locks, and best practices.
Open lessonLesson 52
Deadlock and Inter-Thread Communication
Learn Java Deadlock and Inter-Thread Communication with examples. Understand wait(), notify(), notifyAll(), thread coordination, deadlock prevention, and best practices.
Open lessonJVM Internals & Capstone
How Java manages memory under the hood, and building apps for a global audience.
Lesson 59
Stack Memory vs Heap Memory
Learn Java Stack Memory vs Heap Memory with examples. Understand differences, uses, JVM memory management, StackOverflowError, and OutOfMemoryError.
Open lessonLesson 60
Garbage Collection
Learn Java Garbage Collection with examples. Understand unreferenced objects, System.gc(), finalize(), heap memory cleanup, and JVM garbage collection basics.
Open lessonLesson 61
Internationalization and Localization (I18N and L10N)
Learn Java Internationalization and Localization (I18N/L10N) with Locale, ResourceBundle, DateFormat, and NumberFormat examples for dates, time, numbers, and currency.
Open lesson