C taught you the machine. This teaches you the model.
Every C skill you have still applies. What is new is not the syntax — it is a different way of organising a program: around the data itself, not around the sequence of steps.
After this lesson
You should be able to
- Explain what problem object-oriented programming exists to solve.
- Describe what each of the five units adds, and how it connects to CS105ES and CS205ES.
- Recognise that Java syntax you have not seen is usually a C idea with new spelling.
The problem this course exists to solve
CS105ES gave you functions and CS205ES gave you data structures, but in both, the data and the code that touches it live apart. A struct holding a student's marks has no idea which functions are allowed to change it — any function anywhere in the file can reach in and edit it. That works fine for small programs. It becomes chaos once a real project has dozens of files and hundreds of functions all touching the same data in slightly different ways.
Object orientation's answer is to bind data and the functions allowed to touch it into a single unit, and to hide the data itself behind those functions. You already did a small version of this: a well-designed C function that takes a struct and returns a new one, rather than letting every caller poke at the fields directly, is the same instinct. Java simply makes that discipline the default, not a habit you have to remember.
The five units, as one story
Unit 1 rebuilds your C fundamentals in Java syntax — mostly familiar territory — and then introduces the one genuinely new idea: a class as a blueprint and an object as a real thing built from it. Unit 2 teaches inheritance, letting one class reuse and extend another instead of copying code, plus interfaces, which describe what a type can do without saying how. Unit 3 covers exceptions, a structured way to handle failure that replaces C's habit of returning -1 and hoping the caller checks, plus multithreading, running more than one thing at once.
Unit 4 explores Java's own built-in toolbox — String, Object, and the util and io packages — plus event handling, making a program react to a click instead of running top to bottom the way every C program you have written so far did. Unit 5 closes with Swing, building an actual window-based interface. Each unit stays grounded in the C you already know; Java's syntax changes, but the reasoning habits from CS105ES and CS205ES carry over directly.
What actually changes, and what does not
Loops, conditions, operators, and functions still work the way you expect — Java just calls a function inside a class a method, and the syntax for if, while, and for is close enough to C that you will read it without translating. What is genuinely different is the mental model: instead of writing a sequence of steps that operate on separate data, you will design a small number of classes, each responsible for its own data, and write programs as those objects sending each other requests.
That shift is worth taking seriously rather than rushing past, because every remaining unit in this course assumes you have internalised it. A student who treats Java as "C with classes bolted on" writes working code for a while and then hits a wall in Unit 2, where inheritance only makes sense if classes are already something you think in, not just something you type.
Try it yourself
Recall a C program you wrote for CS105ES that used a struct (for example, a student record with roll number, name, and marks). List every function in that program that touched the struct's fields directly.
Need a hint?
Include every function, even small ones like a print function — the point is to see how many separate places had access to the same data.
Check the worked solution
Most CS105ES programs have three or four functions all reaching into the same struct: one to read input, one to compute something, one to print, maybe one to validate. Nothing stopped the print function from also silently changing a field — the language did not enforce any boundary. That absence of a boundary is exactly what object orientation adds back in.
Quick check
What is the core problem object-oriented programming is designed to solve?
Why this lesson exists
Syllabus mapping
Need for OOP paradigm. · Object oriented thinking and Java Basics.
Maps to course outcome CO1.