AnyCompiler

Free · No signup

Java Tutorial

Learn Java from the ground up. Every code example on every lesson is real and runnable — the output shown was captured from an actual execution on this site's own compiler, not typed by hand — and you can try each one yourself with one click.

  1. 1Introduction to Java
  2. 2Your First Java Program
  3. 3Variables and Types
  4. 4Operators and Control Flow
  5. 5Methods
  6. 6Arrays and ArrayList
  7. 7Strings
  8. 8Classes and Objects
  9. 9Encapsulation
  10. 10Inheritance
  11. 11Polymorphism and Interfaces
  12. 12Abstract Classes
  13. 13Exception Handling
  14. 14Generics
  15. 15The Collections Framework
  16. 16Lambdas and Streams
  17. 17static and final
  18. 18The Optional Type

More lessons are added regularly. Want to practice outside the tutorial? Open the Java compiler. Prefer C++? Read the C++ tutorial. Prefer Rust? Read the Rust tutorial. Prefer Go? Read the Go tutorial. Prefer TypeScript? Read the TypeScript tutorial. Prefer JavaScript? Read the JavaScript tutorial. Prefer Python? Read the Python tutorial. Prefer C? Read the C tutorial. Prefer Hindi? Hindi mein padhein. Prefer Urdu? Roman Urdu mein parhein. ¿Prefieres español? Leer en español. Prefere português? Ler em português.