Home›Java Tutorial
Free course
Java Tutorial
Learn Java programming from absolute zero, one small and easy step at a time. No experience needed. Every idea is explained with slides first, then run for real with Java 17, so you see exactly what each line prints and why.
Course contents
Every lesson has its own page with the explanation, code you can copy, the real output, screenshots from the video, and a link that jumps straight to that moment in the video.
1. What Java Is, Where Java Is Used and How Java Runs Your Code
2. Installing the JDK, Trying Java in JShell and Your First Program
3. The main Method, println and print, and Comments
- The main Method8:14
- println and print9:51
- Comments11:11
4. Variables, Primitive Types, int and long
- Variables12:39
- Primitive Types14:12
- int and long15:23
5. double and float, Arithmetic, Division and Remainder
- double and float16:41
- Arithmetic18:04
- Division and Remainder19:17
6. char and boolean, Type Casting, Practice: A Simple Calculator
- char and boolean20:42
- Type Casting21:49
- Practice: A Simple Calculator23:28
7. Strings, Joining Strings and String Methods
- Strings24:51
- Joining Strings26:16
- String Methods27:23
8. Comparing Strings, Escapes and Text Blocks, String.format
- Comparing Strings28:39
- Escapes and Text Blocks30:16
- String.format31:38
9. Reading Input with Scanner, Reading Numbers, Practice: A Receipt
- Reading Input with Scanner32:52
- Reading Numbers33:51
- Practice: A Receipt35:12
10. Comparison Operators, if, else and else if
- Comparison Operators36:34
- if37:50
- else and else if39:00
11. Logical Operators, The Ternary Operator and switch
- Logical Operators40:24
- The Ternary Operator41:50
- switch42:44
12. Switch Expressions, Nested Decisions, Practice: Grade Checker
- Switch Expressions43:43
- Nested Decisions44:57
- Practice: Grade Checker45:59
13. while Loops, do while and for Loops
- while Loops47:20
- do while48:43
- for Loops49:53
14. break and continue, Nested Loops and Loop Patterns
- break and continue51:02
- Nested Loops52:05
- Loop Patterns53:10
15. Counting and Summing, Infinite Loops and Off-by-One, Practice: Times Table
16. What an Array Is, Creating Arrays and Looping Over Arrays
- What an Array Is57:45
- Creating Arrays58:53
- Looping Over Arrays1:00:09
17. The Enhanced for Loop, The Arrays Class and Searching an Array
- The Enhanced for Loop1:01:24
- The Arrays Class1:02:37
- Searching an Array1:03:38
18. Two-Dimensional Arrays, Common Array Mistakes, Practice: Top Scores
- Two-Dimensional Arrays1:04:59
- Common Array Mistakes1:06:16
- Practice: Top Scores1:07:41
19. Defining Methods, Parameters and Return Values
- Defining Methods1:09:07
- Parameters1:10:15
- Return Values1:11:26
20. Overloading, Scope and Pass by Value
- Overloading1:12:39
- Scope1:13:36
- Pass by Value1:14:50
21. Recursion, Varargs, Practice: Temperature Converter
- Recursion1:16:02
- Varargs1:17:30
- Practice: Temperature Converter1:18:28
22. Classes and Objects, Fields and Constructors
- Classes and Objects1:19:55
- Fields1:21:49
- Constructors1:22:41
23. The this Keyword, Instance Methods and static
- The this Keyword1:24:09
- Instance Methods1:25:22
- static1:26:39
24. Access Modifiers, Getters and Setters, and toString
- Access Modifiers1:28:11
- Getters and Setters1:29:23
- toString1:30:35
25. Encapsulation, Inheritance and super
- Encapsulation1:31:42
- Inheritance1:32:59
- super1:34:27
26. Overriding, Polymorphism and Abstract Classes
- Overriding1:35:37
- Polymorphism1:37:02
- Abstract Classes1:38:01
27. Interfaces, Records and Enums
- Interfaces1:39:29
- Records1:41:01
- Enums1:42:24
28. ArrayList, Generics and Wrapper Classes
- ArrayList1:43:56
- Generics1:45:22
- Wrapper Classes and Autoboxing1:46:41
29. HashMap, Looping Over a Map and HashSet
- HashMap1:48:00
- Looping Over a Map1:49:21
- HashSet1:50:20
30. Sorting with Comparator, Removing While Looping, Practice: Word Counter
- Sorting with Comparator1:51:25
- Removing While Looping1:52:55
- Practice: Word Counter1:53:56
31. What Exceptions Are, try and catch, and finally
- What Exceptions Are1:55:18
- try and catch1:56:44
- finally1:58:08
32. Checked and Unchecked, throw and Custom Exceptions, try-with-resources
- Checked and Unchecked1:59:06
- throw and Custom Exceptions2:00:33
- try-with-resources2:01:49
33. Writing Files, Reading Files, Practice: Save and Load
- Writing Files2:03:01
- Reading Files2:04:13
- Practice: Save and Load2:05:20
34. Lambdas, Functional Interfaces and Method References
- Lambdas2:07:38
- Functional Interfaces2:09:16
- Method References2:10:44
35. Streams, filter, map and collect, More Stream Operations
- Streams2:11:44
- filter, map and collect2:13:13
- More Stream Operations2:14:11
36. Optional, var and Pattern Matching
- Optional2:15:18
- var2:16:50
- Pattern Matching2:17:47
37. StringBuilder, Dates and Times, Packages and Imports
- StringBuilder2:19:03
- Dates and Times2:20:29
- Packages and Imports2:21:37
38. Project: The Plan, The Task Record and The TaskList Class
- Project: The Plan2:22:55
- Project: The Task Record2:24:08
- Project: The TaskList Class2:25:17
39. Project: Saving Tasks, Loading Tasks and Reports with Streams
- Project: Saving Tasks2:26:20
- Project: Loading Tasks2:27:16
- Project: Reports with Streams2:28:28
40. Project: The Menu, Where to Go Next and Course Recap
- Project: The Menu2:29:34
- Where to Go Next2:30:58
- Course Recap2:32:01