Java Study Guide — Roadmap to Learn Java

Soumya
5 min readAug 3, 2022

Here is the approximate study plan I followed while learning Java at university. These topics were spread out over two years for me, but below I condensed them to 25 weeks based on what I think is a good pace. This study guide can be used as a checklist while learning Java individually or as part of a course.

Week 1:

Getting started

  • Learn about the CLASSPATH system variable and how to set it based on the operating system
  • Learn about how comments are written (inline comments and multi-line comments)
  • Understand the purpose and syntax of the main method
  • Learn how to compile and run programs both using an IDE and command line (using java and javac commands)
  • Write Java programs that output messages to the terminal
  • Understand the difference between print and println

Variables

  • Understand the purpose of variables
  • Be introduced to primitive types (boolean, char, byte, short, long, float, double), and String
  • Learn how to declare and assign variables

Arithmetic expressions

  • Understand how arithmetic expressions are used to perform calculations
  • Understand how the result of the division operator depends on the types of its operands (i.e. integer vs. non-integer division)
  • Learn about post- and pre-decrement/increment operators
  • Learn how to concatenate Strings using +
  • Become familiar with operator precedence in expressions
  • Understand how brackets can be used in computing expressions

Week 2:

Using methods

  • Learn how to call a method
  • Learn about method signatures
  • Be introduced to the class java.util.Random
  • Be introduced to some methods of the classes java.lang.Math and java.lang.String

Keyboard Input

  • Learn how to write programs that accept keyboard input from the user
  • Learn about the class java.util.Scanner and how to use its methods like nextLine() and nextInt()

Week 3:

Boolean expressions

  • Understand relational operators such as >,>=, <, <=, ==, and !=
  • Write Boolean expressions using relational operators
  • Use logical operators such as &&, ||, and !

Conditional statements

  • Learn about if, elseif, and else
  • Learn about switch statements
  • Understand the ternary operator in Java

Week 4, 5:

Loops

  • Understand that loops are used to program repetition
  • Understand the syntax and semantics of for and while loops
  • Become familiar with nested loops
  • Learn how to use break to force exit from a loop
  • Be introduced to the keyword ‘continue’
  • Learn about the enhanced for loop

Formatting Strings

  • Learn to use String.format()
  • Learn about printf

Week 6:

More about methods

  • Be introduced to the difference between static and non-static methods
  • Understand the difference between void and non-void methods
  • Understand method overloading

Week 7:

One-dimensional arrays:

  • Learned how to declare and initialize an array
  • Use loops to go through arrays
  • Learn about array index out of bounds exceptions

Week 8, 9:

Defining methods

  • Learn how to define void static methods
  • Learn how to define non-void static methods
  • Learn how to use parameters
  • Learn about return types

Week 10:

Command-line arguments

  • Learn how to use command-line arguments

Recursion

  • Learn how to define and use recursive methods

Week 11:

Packages

  • Learn how to package programs
  • Learn how to import classes from packages

Week 12:

More about variables

  • Understand local variables
  • Understand the scope of variables
  • Distinguish between simple vs. reference types
  • Java uses pass-by-value

Type casting

  • Understand that variables of different types have different sizes
  • Understand type casting (implicit vs. explicit casting)

Week 13:

Files

  • Understand how to read a file character by character
  • Understand how to read a file line by line
  • Learn how to write to a file

Week 14, 15:

Classes

  • Be able to define classes
  • Understand how to use constructors
  • A default constructor is provided only if custom constructors are not defined
  • Become familiar with instance variables and instance methods
  • Learn about the toString() method
  • Be able to create instances of classes

Week 16:

Inheritance

  • Be able to extend classes
  • Understand the use of the keyword ‘super’
  • Learn about method overriding

Week 17:

Exception handling

  • Handle exceptions using try/catch blocks
  • Understand what it means to throw an exception
  • Be introduced to checked vs. unchecked exceptions

Week 18:

Basic data structures

  • ArrayList
  • LinkedList
  • HashMap
  • HashSet

StringBuilder

  • Understand the difference between String and StringBuilder

Week 19:

Objects

  • Understand that objects know and do things — instance variables represent the state of an object, methods represent the behavior of an object
  • Be introduced to the garbage-collectible heap

Object-oriented programming

  • Be introduced to concepts related to object-oriented programming: abstraction, data hiding, polymorphism, inheritance, and dynamic binding

Week 20:

Reference types

  • A reference variable may be active or null
  • Objects may be reachable or abandoned
  • An object is abandoned when the reference goes out of scope permanently, the reference is reassigned, or the reference is set to null
  • The JVM divides the memory into two parts: the stack and the heap.
  • Local variables, i.e. those that are declared within methods, live on the stack
  • Instance variables live on the heap with their containing object

Week 21:

Abstraction

  • Learn about abstract classes
  • Learn about abstract methods
  • Learn about interfaces
  • Understand that Java only supports single inheritance
  • Understand that a class may implement one or more interfaces with the keyword ‘implements’

Week 22:

Final keyword

  • Understand that Java constants are marked with ‘static final’
  • A final variable cannot be changed after it is initialized
  • A final method cannot be overridden
  • A final class cannot be extended

Boxing and unboxing

  • Each primitive type has a class dedicated to it — these classes are known as wrappers
  • Learn about boxing and unboxing
  • Autoboxing and auto-unboxing are automatic wrapping and unwrapping done by the Java compiler

Week 23:

Streams

  • Distinguish between connection streams and chain streams
  • Connection streams represent a connection to a source or destination and must be chained to another stream
  • Chain streams cannot connect to a source or destination
  • A FileWriter connection stream can be chained to a BufferedWriter for efficient writing
  • A FileReader connection stream can be chained to a BufferedReader for efficient reading

Week 24:

Serialization

  • The state of a Java object (i.e. its instance variables) can be saved using serialization
  • Objects, or their super class, must implement Serializable if they are to be serialized
  • An object is serialized to a file by chaining a FileOutputStream to an ObjectOutputStream. Objects are written using write()
  • Static variables are not serialized
  • A transient instance variable will not be serialized
  • An object’s state can be restored from a file by chaining FileInputStream to ObjectInputStream. The objects are read using readObject() in the order in which they were serialized

Week 25:

Threads

  • Understand what is meant by multithreading
  • A thread can be in one of four states: NEW, RUNNABLE, RUNNING and BLOCKED
  • Learn how threads can be created in Java
  • Understand that concurrency problems can occur in multithreaded programs
  • The keyword synchronized can be used to make methods (and even statements) thread-safe
  • Understand that synchronization also has problems (e.g. deadlock)

Feel free to reach out to me for a chat or if you have any questions/comments/suggestions :)

--

--

Soumya

Budding software developer passionate about all things mobile