Java tutorial
Understand object oriented programs and the JVM.
Course contents
Programming fundamentals
Java Basics
Start with a class and main method.
Java conditions, arrays, and loops
Count values that satisfy a boundary condition.
Java methods and exception handling
Separate conversion errors from valid numeric values.
Java recursion and bounded factorial
Use a base case and validate the representable range.
Java variables, types, and casting
Declare typed variables and understand integer division, overflow, and conversions.
Java arrays and strings
Work with fixed-size arrays, common String methods, and the difference between == and equals.
Java method overloading, varargs, and pass by value
Declare several methods with the same name and see what a method can and cannot change.
Object-oriented programming
Java constructors and encapsulation
Initialize private fields and validate changes through methods.
Java inheritance and method overriding
Use a superclass reference to call subclass behavior.
Java interfaces and composition
Depend on a contract and inject a collaborating object.
Java abstract classes and enums
Define a shared base with an abstract method, and a fixed set of constants with fields.
Java generics and bounded types
Write one class and one method that work for many types while the compiler checks them.
Java equals, hashCode, and toString
Define when two objects are equal so that they work correctly in sets and maps.
Data structures and algorithms
Java ArrayList and generics
Use a resizable, type-checked sequence.
Java binary search and interval bounds
Implement logarithmic search on an ascending array.
Java stacks and balanced brackets
Use a stack to check that brackets are properly nested.
Java ArrayDeque as a queue
Choose queue operations with explicit empty-queue behavior.
Java maps, sets, and duplicate counting
Track counts and distinct values with separate collection roles.
Java singly linked lists
Build a list of nodes by hand, insert at the front and the back, and reverse it.
Java binary search trees
Insert values into a tree that keeps smaller values on the left, and traverse it in sorted order.
Java sorting: insertion sort, merge sort, and comparators
Implement two sorts by hand and sort objects with a Comparator.
Java priority queues and heaps
Always remove the smallest (or largest) item, and find the k largest values.