Java Programming
Java from the first program to classes, interfaces, exceptions, collections, generics, lambdas and streams, with every program run and traced in your browser.
- Level
- Beginner
- Time
- About 24 hours
- Modules
- 5
- Lessons
- 15
- Exercises
- 45
Java runs banking systems, Android apps, big-data tools and a large share of the world's back-end servers, and it is one of the most taught languages in universities. This course teaches Java 17 from the first line of code to the collections, generics, lambdas and streams of modern Java.
Every example runs on StepVioz's own Java in your browser, step by step in the visualizer, and every exercise is checked against hidden tests. The same programs also compile and run unchanged on the real JDK.
What you will learn
- Write, compile-check and run Java programs that read input and print results
- Use types, control flow, methods, arrays and strings correctly
- Design classes with encapsulation, inheritance, interfaces, enums and records
- Handle errors with exceptions and organise data with lists, maps, sets and queues
- Write generic classes and methods, lambdas and stream pipelines
- Build small complete programs with clear responsibilities
Skills you will gain
- Java syntax and types
- Object-oriented design
- Exceptions and validation
- The Collections framework
- Generics, lambdas and streams
Before you start
- No previous programming is required, though the Python or C course helps
- Comfort with basic arithmetic and reading careful instructions
- Nothing to install: StepVioz's Java runs in your browser
Where it is used
- Back-end and enterprise applications
- Android development
- University courses and exams in Java
- Technical interviews in Java
Modules
Module 1: Java basics
The structure of a Java program, printing and input, variables and types, and decisions and loops.
- 1
Your first Java program
How a Java program is laid out, how javac and the JVM turn it into a running program, printing with println, print and printf, and reading input with Scanner.
- 2
Variables and types
Java's primitive types, int and long, double, char and boolean, String, declaring variables with types or var, constants with final, casts, integer division, and overflow.
- 3
Decisions and loops
if, else if and else, comparison and logical operators, the switch statement and the newer switch expression, and for, while, do-while and enhanced for loops with break and continue.
Module 2: Methods, arrays and strings
Writing static methods, arrays and two-dimensional arrays, and working with strings and StringBuilder.
- 1
Methods
Writing static methods with parameters and return types, void methods, overloading, recursion with a base case, and why Java passes arguments by value.
- 2
Arrays
Creating and filling arrays, indexes and length, looping with for and enhanced for, the Arrays helper class, references to arrays, default values, and two-dimensional arrays.
- 3
Strings and StringBuilder
Working with text: String methods, immutability, comparing with equals instead of ==, characters and char arithmetic, splitting and joining, building text efficiently with StringBuilder, and String.format.
Module 3: Object-oriented Java
Classes and objects, inheritance and polymorphism, interfaces, enums and records.
- 1
Classes and objects Intermediate
Defining classes with fields, constructors and methods, creating objects with new, encapsulation with private fields and getters, this, static members, toString, and object references.
- 2
Inheritance and polymorphism Intermediate
Extending classes with extends and super, overriding methods with @Override, protected members, abstract classes and methods, polymorphism through superclass references, and instanceof with pattern matching.
- 3
Interfaces, enums and records Intermediate
Interfaces as contracts with default methods, implementing several interfaces, Comparable for natural ordering, enums with fields and methods, and records for compact immutable data classes.
Module 4: Errors and collections
Exceptions, lists and maps, and sets, queues and stacks.
- 1
Exceptions Intermediate
How Java reports errors with exceptions: try, catch and finally, checked and unchecked exceptions, throwing your own, declaring them with throws, and the common runtime exceptions.
- 2
Lists and maps Intermediate
The two collections Java programs use most: ArrayList for ordered lists that grow, and HashMap and TreeMap for looking values up by key, with generics, wrapper types and iteration.
- 3
Sets, queues and stacks Intermediate
Collections for uniqueness and order of processing: HashSet, TreeSet and LinkedHashSet, queues and stacks with ArrayDeque, PriorityQueue, and how equals and hashCode decide what counts as the same.
Module 5: Modern Java
Generics, lambdas and streams, and designing a complete program.
- 1
Generics Advanced
Writing classes and methods that work with any type while keeping type safety: type parameters, the diamond operator, generic methods, bounded types such as T extends Comparable, and wildcards.
- 2
Lambdas and streams Advanced
Passing behaviour as values with lambdas and method references, functional interfaces, comparators, and processing collections declaratively with streams: filter, map, sorted, collect, groupingBy and Optional.
- 3
Putting it together: designing a complete program Advanced
Building a small application from the whole course: splitting it into classes with clear responsibilities, choosing collections, validating with exceptions, separating input from logic, and testing by hand.
Projects
- A student records system Build a console program that manages students, courses and marks: enrolment, marks entry, transcripts, averages and rankings, with every rule enforced and every error reported clearly.
- A text adventure engine Build a small text adventure: rooms connected by exits, items to pick up and use, and a parser for commands such as go north, take key and use key.
What to learn next
- Object-Oriented Programming in C++ Classes, constructors and destructors, operators, inheritance, virtual functions, templates, the STL and exceptions, with every object on screen.
- Data Structures Lists, stacks, queues, trees, heaps, hash tables and graphs, built in C node by node, with every pointer drawn.
- Algorithms Searching, sorting, recursion, greedy choices, dynamic programming and graph algorithms, with the cost of each one counted.