Overview
This guide takes you from zero Java experience to building a real working project over 10 weeks. It is designed for students preparing for AP Computer Science A, college freshmen in their first CS course, or anyone targeting a junior software engineering role where Java is required.
Java is more structured than Python — it is statically typed, compiled, and more verbose. That might sound like a downside, but it is actually a strength for learning. Java forces you to think clearly about types, structure, and design. If you understand Java well, picking up other languages becomes much easier.
Who This Guide Is For
- High school students taking AP Computer Science A
- College students in introductory CS courses (CS 101/CS 1)
- Career changers targeting backend or Android development roles
- Anyone who wants a solid foundation in a strongly typed, object-oriented language
Java vs. Python — What to Expect
If you have already learned Python, Java will feel stricter at first. Every variable needs a declared type. Every program lives inside a class. You compile before you run. These constraints feel annoying early on, but they teach you habits that make you a stronger programmer in any language.
The 10-Week Curriculum
Week 1 — Setup, Hello World, Variables, and Data Types
Goal: Get your tools installed and write your first Java programs.
Topics:
- Installing the JDK (Java Development Kit) — use JDK 17 LTS or newer
- Setting up IntelliJ IDEA (Community Edition is free and excellent)
- Understanding the structure of a Java program:
public class,mainmethod - Primitive data types:
int,double,boolean,char - Reference type:
String - Declaring and initializing variables
System.out.println()— printing output- Basic arithmetic operators
Practice Exercises:
- Write a Hello World program. Then modify it to print your name.
- Declare variables for your name (String), age (int), height in feet (double), and whether you own a pet (boolean). Print each one.
- Calculate and print the area and perimeter of a rectangle given its width and height.
- What happens if you try to assign a decimal value to an
int? Try it and read the compiler error.
Week 2 — Control Flow: If/Else and Loops
Goal: Make your programs branch and repeat.
Topics:
if,else if,else- Comparison operators and logical operators (
&&,||,!) whileloopsforloopsdo-whileloopsbreakandcontinueswitchstatements (intro)
Practice Exercises:
- Write a program that reads an integer and prints whether it is positive, negative, or zero
- Print all even numbers from 1 to 50 using a
forloop - Write a number guessing game: the program picks a number (hardcode it for now), the user guesses, and the program says "too high," "too low," or "correct"
- Use a
whileloop to sum all integers from 1 to 100 and print the result - Print a multiplication table for numbers 1 through 10
Week 3 — Methods and Scope
Goal: Write organized, reusable code using methods.
Topics:
- Defining methods with a return type, name, and parameters
voidmethods vs. methods that return a value- Method overloading (same name, different parameters)
- Variable scope: local vs. instance
- Passing arguments by value
- The
statickeyword (intro — whymainis static) - Writing and calling helper methods
Practice Exercises:
- Write a method
int add(int a, int b)and call it frommain - Write a method
boolean isEven(int n)that returns true if n is even - Write a method
double celsiusToFahrenheit(double c)and test it with several values - Overload a
greetmethod: one version takes just a name, another takes a name and a time of day ("Good morning, Parth!") - Refactor your guessing game to use at least two separate methods
Week 4 — Arrays and ArrayLists
Goal: Store and work with collections of data.
Topics:
- Declaring and initializing arrays
- Accessing elements by index
- Iterating with
forand enhancedfor(for-each) - Array length
- Common array problems: min, max, sum, average
- Introduction to
ArrayList<T> - Adding, removing, and accessing elements in an ArrayList
- When to use an array vs. an ArrayList
Practice Exercises:
- Create an array of 5 integers and print their sum and average
- Write a method that takes an
int[]and returns the largest value - Write a method that reverses an array and prints the result
- Create an
ArrayList<String>of your three favorite books. Add two more, remove one, and print the final list. - Write a program that stores 10 grades in an ArrayList and prints how many are passing (>= 60)
Week 5 — OOP: Classes, Objects, and Constructors
Goal: Model real-world things as objects using classes.
Topics:
- What a class is and how it differs from a primitive
- Instance variables (fields)
- Constructors: default and parameterized
thiskeyword- Getters and setters (encapsulation)
- Creating objects with
new - The
toString()method
Practice Exercises:
- Create a
Carclass with fields:make,model,year. Add a constructor and atoString()method. Instantiate three cars and print them. - Create a
BankAccountclass with a balance, and methodsdeposit(double amount),withdraw(double amount), andgetBalance() - Create a
Studentclass withname,id, andgpa. Add a methodisHonors()that returns true if GPA >= 3.5 - Create an
ArrayList<Student>with five students and print only those on the honors list
A note on the AP exam. As of the 2025-26 Course and Exam Description, AP Computer Science A covers four units — Using Objects and Methods, Selection and Iteration, Class Creation, and Data Collections. Inheritance, polymorphism, interfaces and abstract classes are no longer examined. Weeks 6 and 7 are kept in this guide because they matter for college coursework and real engineering work, not because the exam asks for them.
Week 6 — Inheritance and Polymorphism
Goal: Build class hierarchies and write flexible code.
Topics:
- What inheritance is and when to use it
extendskeyword- Superclass and subclass
- Method overriding and
@Override superkeyword — calling the parent constructor and methods- Polymorphism: a subclass object assigned to a superclass reference
- The
Objectclass and its methods
Practice Exercises:
- Create an
Animalclass with aspeak()method. CreateDogandCatsubclasses that overridespeak()with appropriate sounds. - Create a
Shapeclass with agetArea()method. CreateCircleandRectanglesubclasses that implement it correctly. - Store a
Dogand aCatin anArrayList<Animal>and callspeak()on each using a loop. Observe how polymorphism works. - Override
toString()in yourStudentclass from Week 5 and verify it prints correctly when passed toSystem.out.println()
Week 7 — Interfaces and Abstract Classes
Goal: Design more flexible and modular code.
Topics:
- What an interface is and why it is different from a class
- Implementing an interface with
implements - Interfaces as contracts
- Abstract classes: when to use them instead of interfaces
- The
abstractkeyword - Multiple interface implementation
- Common built-in interfaces:
Comparable<T>,Runnable(intro)
Practice Exercises:
- Create a
Printableinterface with aprintInfo()method. Have yourStudentandCarclasses implement it. - Create an abstract class
Vehiclewith an abstract methodgetFuelType(). CreateElectricCarandGasCarsubclasses. - Make your
Studentclass implementComparable<Student>so students can be sorted by GPA. UseCollections.sort()to test it. - Explain in a comment in your code: when would you choose an interface vs. an abstract class?
Week 8 — Exception Handling and File I/O
Goal: Write robust programs that handle errors and persist data.
Topics:
- What exceptions are: checked vs. unchecked
try,catch,finally- Throwing exceptions with
throw - Common exceptions:
NullPointerException,ArrayIndexOutOfBoundsException,NumberFormatException - Reading files with
ScannerandFileReader - Writing files with
PrintWriterandFileWriter - The
IOExceptionand handling it properly
Practice Exercises:
- Write a program that reads integers from the user until they enter "quit" — handle
NumberFormatExceptionfor invalid input - Write a program that reads a text file line by line and prints each line with a line number
- Write a program that takes a list of students (from Week 5) and saves them to a CSV file
- Add file-save functionality to your
BankAccountfrom Week 5 so transactions are logged
Week 9 — Collections: HashMap, HashSet, LinkedList
Goal: Use the right data structure for the job.
Topics:
- Review of
ArrayList— time complexity basics (why it matters) HashMap<K, V>: storing key-value pairs,put(),get(),containsKey(), iteratingHashSet<T>: unique elements,add(),contains(), set operationsLinkedList<T>: intro, when it beats ArrayList- Iterating with
Iteratorand enhanced for loops - The Collections utility class:
sort(),reverse(),frequency()
Practice Exercises:
- Write a word frequency counter using a
HashMap<String, Integer>— given a sentence, count how many times each word appears - Write a program that finds all duplicate values in a list using a
HashSet - Build a simple phone book using a
HashMap<String, String>(name → phone number) with add, lookup, and delete operations - Sort your
ArrayList<Student>by name usingCollections.sort()(requiresComparablefrom Week 7)
Week 10 — Mini Project Week
Goal: Build one complete, working Java application.
Suggested Projects (pick one):
- Student Grade Tracker: Add/remove students, record grades, compute averages, save to and load from a file
- Simple Inventory System: Track products with name, quantity, and price; support add, remove, search, and total-value calculations; persist data to a file
- Library Catalog: Manage a collection of books, mark them as checked out or available, search by title or author
What Your Project Should Include:
- At least two classes (beyond
main) - At least one interface or abstract class
- A collection (ArrayList or HashMap)
- File I/O (save and load)
- Exception handling
- A menu-driven command-line interface
Steps:
- Write out your program's features in plain English before writing any code
- Design your classes on paper first — what fields and methods does each need?
- Build the simplest version first, then add features
- Test each class independently before wiring them together
Resources
Official and Core
- Java SE Documentation — official reference
- JDK 17 API Docs — look up any class or method
Practice Platforms
- HackerRank — Java — beginner-friendly, good for syntax practice
- LeetCode — Easy problems — great once you are through Week 4
- CodingBat Java — excellent for short, focused logic problems
- Exercism.io — free exercises with mentor feedback
AP Computer Science A Specific
- AP CS A College Board Course Description — covers exactly the topics tested
- Barron's AP Computer Science A — solid prep book with practice exams
A Note on Java's Verbosity
Java feels like a lot of typing compared to Python. That is intentional. When you declare ArrayList<Student> students = new ArrayList<>();, every word is meaningful: the type, the generic parameter, the constructor call. Over time, that explicitness becomes an asset — you always know what type you are working with, and the compiler catches entire categories of bugs before your program even runs.
If you are learning Java for AP CS A, stick closely to the topics on the College Board's curriculum list. If you are learning for a job, pay extra attention to Weeks 5-9 — OOP, collections, and file I/O are where most of your real work will happen.
Written by Parth Shah. For tutoring inquiries, visit ajconsultation.com.