AI Hints
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.

📚 120 lessons▶ 2:32:01+ of video💻 201 code examples🖼 0 screenshots
The complete Java course, free on YouTubeWatch on YouTube ↗

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

  1. What Java Is0:00
  2. Where Java Is Used1:20
  3. How Java Runs Your Code2:26

2. Installing the JDK, Trying Java in JShell and Your First Program

  1. Installing the JDK4:22
  2. Trying Java in JShell5:48
  3. Your First Program6:49

3. The main Method, println and print, and Comments

  1. The main Method8:14
  2. println and print9:51
  3. Comments11:11

4. Variables, Primitive Types, int and long

  1. Variables12:39
  2. Primitive Types14:12
  3. int and long15:23

5. double and float, Arithmetic, Division and Remainder

  1. double and float16:41
  2. Arithmetic18:04
  3. Division and Remainder19:17

6. char and boolean, Type Casting, Practice: A Simple Calculator

  1. char and boolean20:42
  2. Type Casting21:49
  3. Practice: A Simple Calculator23:28

7. Strings, Joining Strings and String Methods

  1. Strings24:51
  2. Joining Strings26:16
  3. String Methods27:23

8. Comparing Strings, Escapes and Text Blocks, String.format

  1. Comparing Strings28:39
  2. Escapes and Text Blocks30:16
  3. String.format31:38

9. Reading Input with Scanner, Reading Numbers, Practice: A Receipt

  1. Reading Input with Scanner32:52
  2. Reading Numbers33:51
  3. Practice: A Receipt35:12

10. Comparison Operators, if, else and else if

  1. Comparison Operators36:34
  2. if37:50
  3. else and else if39:00

11. Logical Operators, The Ternary Operator and switch

  1. Logical Operators40:24
  2. The Ternary Operator41:50
  3. switch42:44

12. Switch Expressions, Nested Decisions, Practice: Grade Checker

  1. Switch Expressions43:43
  2. Nested Decisions44:57
  3. Practice: Grade Checker45:59

13. while Loops, do while and for Loops

  1. while Loops47:20
  2. do while48:43
  3. for Loops49:53

14. break and continue, Nested Loops and Loop Patterns

  1. break and continue51:02
  2. Nested Loops52:05
  3. Loop Patterns53:10

15. Counting and Summing, Infinite Loops and Off-by-One, Practice: Times Table

  1. Counting and Summing54:22
  2. Infinite Loops and Off-by-One55:25
  3. Practice: Times Table56:36

16. What an Array Is, Creating Arrays and Looping Over Arrays

  1. What an Array Is57:45
  2. Creating Arrays58:53
  3. Looping Over Arrays1:00:09

17. The Enhanced for Loop, The Arrays Class and Searching an Array

  1. The Enhanced for Loop1:01:24
  2. The Arrays Class1:02:37
  3. Searching an Array1:03:38

18. Two-Dimensional Arrays, Common Array Mistakes, Practice: Top Scores

  1. Two-Dimensional Arrays1:04:59
  2. Common Array Mistakes1:06:16
  3. Practice: Top Scores1:07:41

19. Defining Methods, Parameters and Return Values

  1. Defining Methods1:09:07
  2. Parameters1:10:15
  3. Return Values1:11:26

20. Overloading, Scope and Pass by Value

  1. Overloading1:12:39
  2. Scope1:13:36
  3. Pass by Value1:14:50

21. Recursion, Varargs, Practice: Temperature Converter

  1. Recursion1:16:02
  2. Varargs1:17:30
  3. Practice: Temperature Converter1:18:28

22. Classes and Objects, Fields and Constructors

  1. Classes and Objects1:19:55
  2. Fields1:21:49
  3. Constructors1:22:41

23. The this Keyword, Instance Methods and static

  1. The this Keyword1:24:09
  2. Instance Methods1:25:22
  3. static1:26:39

24. Access Modifiers, Getters and Setters, and toString

  1. Access Modifiers1:28:11
  2. Getters and Setters1:29:23
  3. toString1:30:35

25. Encapsulation, Inheritance and super

  1. Encapsulation1:31:42
  2. Inheritance1:32:59
  3. super1:34:27

26. Overriding, Polymorphism and Abstract Classes

  1. Overriding1:35:37
  2. Polymorphism1:37:02
  3. Abstract Classes1:38:01

27. Interfaces, Records and Enums

  1. Interfaces1:39:29
  2. Records1:41:01
  3. Enums1:42:24

28. ArrayList, Generics and Wrapper Classes

  1. ArrayList1:43:56
  2. Generics1:45:22
  3. Wrapper Classes and Autoboxing1:46:41

29. HashMap, Looping Over a Map and HashSet

  1. HashMap1:48:00
  2. Looping Over a Map1:49:21
  3. HashSet1:50:20

30. Sorting with Comparator, Removing While Looping, Practice: Word Counter

  1. Sorting with Comparator1:51:25
  2. Removing While Looping1:52:55
  3. Practice: Word Counter1:53:56

31. What Exceptions Are, try and catch, and finally

  1. What Exceptions Are1:55:18
  2. try and catch1:56:44
  3. finally1:58:08

32. Checked and Unchecked, throw and Custom Exceptions, try-with-resources

  1. Checked and Unchecked1:59:06
  2. throw and Custom Exceptions2:00:33
  3. try-with-resources2:01:49

33. Writing Files, Reading Files, Practice: Save and Load

  1. Writing Files2:03:01
  2. Reading Files2:04:13
  3. Practice: Save and Load2:05:20

34. Lambdas, Functional Interfaces and Method References

  1. Lambdas2:07:38
  2. Functional Interfaces2:09:16
  3. Method References2:10:44

35. Streams, filter, map and collect, More Stream Operations

  1. Streams2:11:44
  2. filter, map and collect2:13:13
  3. More Stream Operations2:14:11

36. Optional, var and Pattern Matching

  1. Optional2:15:18
  2. var2:16:50
  3. Pattern Matching2:17:47

37. StringBuilder, Dates and Times, Packages and Imports

  1. StringBuilder2:19:03
  2. Dates and Times2:20:29
  3. Packages and Imports2:21:37

38. Project: The Plan, The Task Record and The TaskList Class

  1. Project: The Plan2:22:55
  2. Project: The Task Record2:24:08
  3. Project: The TaskList Class2:25:17

39. Project: Saving Tasks, Loading Tasks and Reports with Streams

  1. Project: Saving Tasks2:26:20
  2. Project: Loading Tasks2:27:16
  3. Project: Reports with Streams2:28:28

40. Project: The Menu, Where to Go Next and Course Recap

  1. Project: The Menu2:29:34
  2. Where to Go Next2:30:58
  3. Course Recap2:32:01