Java for Beginners

On Breni, Java for Beginners teaches the Java language and object-oriented programming, for learners who want a strongly typed language used in Android apps and large back-end systems. Its 8 courses cover setup, variables and types, control flow, methods and arrays, classes and objects, inheritance and interfaces, collections, and exceptions with a final project. Learners finish able to design classes, use ArrayList and HashMap and build a small app. Undecided beginners can start with Learn to Code. Classes follow methods, as each course unlocks after the one before.

  • 8 courses
  • 10 learning objectives
  • Level: beginner
  • Language: English
  • Price: Subscription, free trial

What you will be able to do

  • Compile and run Java programs from an IDE and the command line
  • Write methods and loops that process arrays of data
  • Design classes with constructors, private fields and getters
  • Use inheritance and interfaces to share behaviour between classes
  • Store and search data with ArrayList and HashMap
  • Handle exceptions and read and write text files

Full curriculum

Part 1 · Java basics

1. Getting Started with Java: Build Your First Program

Write, compile and run a first Java program. Units, in order: What Java is used for; The JDK, the JVM and bytecode; Writing and running Hello World; The main method and classes; Using an IDE such as IntelliJ.

  • — Java Uses and Features
    Learn where Java is used and why people use it.
    • What is Java
    • Java everywhere
  • — JDK, JVM and Bytecode
    Understand how Java runs on different computers and devices.
    • The Java Virtual Machine
    • JDK and Bytecode
  • — Writing Hello World
    Write and run your very first simple Java text program.
    • First Java file
    • Run Hello World
  • — Main Method and Classes
    Learn about basic Java building blocks like classes and main.
    • Java classes
    • The main method
  • — Using IntelliJ IDE
    Use a modern editor to write and run code faster.
    • Setup IntelliJ
    • Code in IntelliJ

2. Java Variables and Types

Store data in typed variables and convert between types. Units, in order: Primitive types; Strings and string methods; Type casting; Operators and expressions; Reading input with Scanner.

3. Java Control Flow

Control program flow with conditions and loops. Units, in order: if, else and switch; for and while loops; The enhanced for loop; break and continue; Nested loops.

Part 2 · Object-oriented Java

4. Methods and Arrays

Write reusable methods and work with arrays. Units, in order: Defining and calling methods; Parameters and return types; Method overloading; Arrays and indexes; Two-dimensional arrays.

5. Classes and Objects

Model real things with classes, fields and constructors. Units, in order: Classes and objects; Fields and constructors; Access modifiers and encapsulation; Static members; The toString and equals methods.

6. Inheritance and Interfaces

Reuse and extend code with inheritance, interfaces and polymorphism. Units, in order: Extending a class; Overriding methods; Abstract classes; Interfaces; Polymorphism in practice.

Part 3 · Real Java

7. Collections and Generics

Store and process groups of objects with the collections framework. Units, in order: ArrayList and when to use it; HashMap for key-value lookups; HashSet for unique values; Generics and type safety; Streams and lambdas.

8. Exceptions, Files and Projects

Handle errors, read files and build a complete program. Units, in order: try, catch and finally; Checked and unchecked exceptions; Reading and writing files; Unit testing with JUnit; Building a library management app.

Sample: Getting Started with Java: Build Your First Program

The opening tier, (Java Uses and Features). Learn where Java is used and why people use it.

What is Java

Discover what Java is and where people use it every day.

Java everywhere

Explore apps, web sites, and devices running Java code.

Questions about Java for Beginners

Is Java good for beginners?

Yes, though it needs more setup than Python. Its strict types catch many mistakes early, which helps beginners build good habits.

Java or Python: which should I learn first?

Python is quicker to start with, while Java shows more of how programs are structured. Learn to Code on Breni compares both before you choose.

How long does it take to learn Java?

The basics take a few weeks of regular practice. Each lesson takes about three minutes, so the 8 courses fit around other commitments.

Is Java the same as JavaScript?

No. They are different languages with different uses, despite the similar names.

Do I get a certificate in Java?

Completing all 8 courses earns a Breni certificate of completion. It is separate from Oracle's Java exams.

Related learning paths

Start Java for Beginners

Get Breni on Google Play and start Java for Beginners Download on the App Store