Java Fundamentals
The course teaches Java fundamentals, covering types, variables, control flow, methods, classes, OOP principles, collections, and exception handling, enabling learners to write robust, maintainable code.
Who Should Take This
New developers, computer‑science students, or anyone transitioning to Java who has little to no programming experience will benefit. They seek to grasp core language constructs, object‑oriented design, and collection APIs to build functional applications and prepare for advanced Java topics.
What's Included in AccelaStudy® AI
Adaptive Knowledge Graph
Practice Questions
Lesson Modules
Console Simulator Labs
Exam Tips & Strategy
20 Activity Formats
Course Outline
68 learning goals
1
Types and Variables
3 topics
Primitive and Reference Types
- Identify Java's eight primitive types (byte, short, int, long, float, double, char, boolean) and describe their size, range, and default values
- Explain the difference between primitive types and reference types and describe how autoboxing and unboxing convert between primitives and their wrapper classes
- Implement variable declarations with explicit types and var (local variable type inference) and describe the rules for when var can and cannot be used
- Analyze the numeric promotion rules for mixed-type arithmetic expressions and evaluate potential precision loss when combining int, long, float, and double operands
Strings and Text
- Describe String immutability and the string pool and explain how equals() differs from == for string comparison
- Implement String operations using charAt, substring, indexOf, contains, replace, split, join, and formatted() for text processing and output formatting
- Implement StringBuilder for efficient string concatenation in loops and analyze the performance difference between String concatenation and StringBuilder append operations
Type Casting, Scope, and Arrays
- Implement type casting between numeric primitives including widening and narrowing conversions and explain when explicit casts are required and potential data loss
- Describe the scope and lifetime of local variables, instance variables, and class (static) variables and explain how final prevents reassignment
- Implement array declaration, initialization, and manipulation including multi-dimensional arrays and Arrays utility methods (sort, binarySearch, copyOf, fill)
- Implement the enhanced for-each loop and Arrays.stream to iterate and transform array elements and compare indexed access with stream-based processing
2
Control Flow
3 topics
Conditional Statements
- Implement if-else if-else chains and the ternary operator to handle multi-branch decision logic with compound boolean conditions
- Implement switch statements and switch expressions (Java 21+ pattern matching) with arrow syntax, multiple case labels, and yield for returning values
- Compare traditional switch statements with switch expressions and evaluate the benefits of exhaustiveness checking and pattern matching for type-safe branching
- Implement guard patterns and null-case handling in switch expressions to create exhaustive type-safe branching over sealed type hierarchies
Loops and Iteration
- Implement for loops, enhanced for-each loops, while loops, and do-while loops with break, continue, and labeled break for nested loop control
- Describe the Iterator and Iterable interfaces and explain how the enhanced for-each loop is compiled to use the iterator protocol internally
- Analyze loop performance characteristics and evaluate when to prefer indexed for loops, enhanced for-each, or stream-based iteration for different collection types
Operators and Pattern Matching
- Implement arithmetic, comparison, logical, bitwise, and assignment operators and describe Java's operator precedence and associativity rules
- Implement instanceof pattern matching (Java 21+) to combine type checking and casting in conditional expressions
3
Methods and Classes
3 topics
Method Definition and Overloading
- Describe method signatures including access modifiers, return types, method names, parameter lists, and the static keyword and explain method overloading rules
- Implement methods with varargs parameters and describe how varargs are compiled to arrays and the restriction that only one varargs parameter is allowed at the end
- Explain Java's pass-by-value semantics for both primitives and reference types and analyze how method arguments behave when objects are mutated inside a method
Class Construction and Records
- Implement classes with constructors, instance fields, and methods and describe how the default constructor, this keyword, and constructor chaining work
- Implement record classes (Java 21+) for immutable data carriers and compare them to traditional classes with manually written constructors, getters, equals, hashCode, and toString
- Implement static fields and methods for class-level state and behavior and explain when to use static factory methods instead of constructors
- Describe the Object class methods including toString, equals, hashCode, getClass, and clone and explain the equals-hashCode contract for correct behavior in hash-based collections
Access Control and Encapsulation
- Describe Java access modifiers (public, protected, default/package-private, private) and explain how each controls visibility across classes and packages
- Implement encapsulation by declaring private fields with public getter and setter methods and validate input within setters to enforce class invariants
- Analyze the trade-offs between exposing fields directly versus using accessor methods and evaluate immutability as a strategy for thread safety and defensive coding
4
Object-Oriented Programming
3 topics
Inheritance and Abstract Classes
- Describe single inheritance in Java using extends and explain how constructors chain through the hierarchy with super() and the implicit call to Object()
- Implement class hierarchies with method overriding using @Override and explain how the JVM performs dynamic dispatch to invoke the most specific method at runtime
- Implement abstract classes with abstract and concrete methods and explain when to prefer abstract classes over interfaces for shared implementation
- Analyze the fragile base class problem and evaluate how changes to superclass implementation can break subclass behavior in deep inheritance hierarchies
Interfaces and Sealed Types
- Describe interfaces including abstract methods, default methods, static methods, and private methods and explain how a class can implement multiple interfaces
- Implement interfaces to define contracts and achieve polymorphism by coding to interfaces rather than concrete implementations
- Implement sealed classes and sealed interfaces (Java 21+) using permits to restrict which classes may extend or implement them and explain their role in pattern matching
- Analyze the diamond problem with default methods in interfaces and evaluate how Java resolves conflicts when a class implements two interfaces with the same default method
- Implement functional interfaces with @FunctionalInterface annotation and explain how single-abstract-method interfaces enable lambda expression usage
Polymorphism and Enums
- Implement polymorphic code using supertype references that hold subtype instances and explain how runtime type determines method behavior
- Implement enum types with fields, constructors, and methods and describe how enums provide type-safe constants with behavior
- Compare inheritance, composition, and delegation patterns and evaluate when to favor composition over inheritance for flexible and maintainable class design
5
Collections Framework
4 topics
Lists and Sets
- Describe the Collections Framework hierarchy including Collection, List, Set, and Map interfaces and their key implementing classes
- Implement ArrayList and LinkedList operations including add, remove, get, set, contains, and iteration and explain their different performance characteristics for random access versus insertion
- Implement HashSet and TreeSet to store unique elements and explain how hashCode() and equals() contracts govern set membership and how Comparable/Comparator enables sorted sets
- Implement Queue and Deque operations using ArrayDeque and LinkedList and describe FIFO versus LIFO access patterns for queue and stack use cases
Maps and Generics
- Implement HashMap and TreeMap operations including put, get, remove, containsKey, and iteration over entrySet and explain how hash collisions are handled
- Implement generic classes and methods using type parameters to create type-safe reusable containers and algorithms
- Describe bounded type parameters, wildcards (? extends T, ? super T), and type erasure and explain the PECS principle for producer and consumer generic collections
- Analyze type erasure in generics and evaluate its impact on runtime type checking, generic array creation, and bridge method generation
Streams and Lambdas
- Implement Stream operations including filter, map, flatMap, reduce, collect, forEach, and terminal operations to process collections in a functional pipeline style
- Implement lambda expressions and method references as concise implementations of functional interfaces including Predicate, Function, Consumer, and Supplier
- Implement Collectors utility methods including toList, toSet, toMap, groupingBy, partitioningBy, and joining to aggregate stream results into collections and summaries
- Analyze when to use streams versus explicit loops and evaluate the readability, performance, and debugging trade-offs of functional versus imperative collection processing
- Implement Optional integration with streams using flatMap to chain operations that may return empty results and avoid nested Optional values
Sorting and Utility Methods
- Implement the Comparable interface to define natural ordering and Comparator instances for custom sort orders using lambda expressions and Comparator.comparing chains
- Implement Collections utility methods including sort, binarySearch, unmodifiableList, synchronizedList, and List.of/Map.of factory methods for immutable collections
- Compare ArrayList, LinkedList, HashSet, TreeSet, HashMap, and TreeMap and evaluate the appropriate collection type based on access patterns, ordering requirements, and thread safety needs
6
Exception Handling
3 topics
Exception Hierarchy and try-catch
- Describe the Java exception hierarchy including Throwable, Error, Exception, and RuntimeException and explain the distinction between checked and unchecked exceptions
- Implement try-catch-finally blocks to handle checked exceptions and explain how the finally block ensures resource cleanup regardless of exception occurrence
- Implement try-with-resources statements using AutoCloseable to automatically close streams, connections, and other resources and explain how suppressed exceptions are tracked
- Implement multi-catch blocks to handle multiple exception types in a single catch clause and explain the restriction that caught types must not be subtypes of each other
Custom Exceptions and Propagation
- Implement custom exception classes extending Exception and RuntimeException with constructors that accept message and cause parameters for exception chaining
- Implement throw statements and throws declarations to propagate exceptions up the call stack and design method signatures that communicate failure modes to callers
- Analyze the trade-offs between checked and unchecked exceptions and evaluate strategies for exception handling including fail-fast, recovery, and logging patterns
Optional and Null Safety
- Implement Optional to represent values that may be absent and use map, flatMap, orElse, orElseGet, and orElseThrow to safely handle nullable results without null checks
- Compare null-returning methods, Optional-returning methods, and exception-throwing methods and evaluate the appropriate error signaling strategy for different API design contexts
- Implement defensive copying and input validation at public API boundaries and evaluate how fail-fast precondition checks using Objects.requireNonNull prevent silent null propagation
Hands-On Labs
15 labs
~380 min total
Console Simulator
Practice in a simulated cloud console or Python code sandbox — no account needed. Each lab runs entirely in your browser.
Scope
Included Topics
- Java 21+ syntax and semantics, primitive and reference types, strings, arrays, control flow with pattern matching, methods and classes, records, access modifiers, inheritance, abstract classes, interfaces, sealed types, polymorphism, enums, Collections Framework (List, Set, Map), generics, streams and lambdas, exception handling, try-with-resources, and Optional
Not Covered
- Spring Framework and Spring Boot
- Jakarta EE (Servlets, JPA, CDI)
- Build tools (Maven, Gradle, Ant)
- Concurrency beyond basic thread safety concepts
- Networking and socket programming
- JDBC and database access
- Reflection and annotation processing
- Module system (JPMS) beyond basic awareness
Ready to master Java Fundamentals?
Adaptive learning that maps your knowledge and closes your gaps.
Subscribe to Access