Lessons

Beginner Java

Learn Java from the first line

Twenty short lessons on the language basics. Each one has an example you can edit and run in the browser.

Start the tutorial

Short lessons

Each page explains one idea, then shows it in a complete program.

Editable examples

Change a value, a condition, or a message and run the sample again.

Browser runner

Lesson code runs on this page. It is a teaching runner, not a full JDK.

Lessons

  1. 1Java Introduction
  2. 2Getting Started
  3. 3Java Syntax
  4. 4Java Output
  5. 5Java Variables
  6. 6Java Data Types
  7. 7Java Type Casting
  8. 8Java Operators
  9. 9Java Strings
  10. 10Java Math
  11. 11Java Booleans
  12. 12Java If and Else
  13. 13Java Switch
  14. 14Java While Loop
  15. 15Java For Loop
  16. 16Java Break and Continue
  17. 17Java Arrays
  18. 18Java Methods
  19. 19Java Classes
  20. 20Java Constructors