Course home
OOP THROUGH JAVA UNIT III · UI24PC320CS JDK 21
3UNIT

12 classes · 3 labs · 9 PYQs

Strings, java.lang & I/O.

What a String actually is — the pool, immutability, and the cost of + in a loop · StringBuffer vs StringBuilder · wrappers, the Object contract & generics · files, byte & character streams · saving whole objects to disk with serialization.

PART J · C25–C28 · STRINGS LAB 6 · STRINGS PART K · C29–C32 · WRAPPERS + OBJECT + GENERICS + I/O LAB 7 · FILTER & BUFFERED I/O PART L · C33–C36 · SERIALIZATION + UTILITIES + CLOSE LAB 8 · SERIALIZATION

THE ROADMAP · C25 → C36

Twelve classes. Three labs. One chat app, one records system, one save file.

Part J dissects String on a chat-app message spine. Part K walks wrappers → Object → generics → streams on Student records & file I/O. Part L saves whole Student CGPA objects to disk with serialization, then closes the unit.

PART J · C25–C28 · STRINGS — THE CHAT-APP SPINE
C25CLASS
The String pool & immutability

Why "hi" == "hi" can be true but new String("hi") breaks it — the pool, immutability, and what every chat message really costs.

PART JSOON
C26CLASS
StringBuffer vs StringBuilder

The mutable siblings — capacity, append chains, and when + in a loop quietly burns memory. (P1·Q17a)

PART JSOON
C27CLASS
The String method toolbox

substring · indexOf · split · trim · replace — the working set, drilled on real chat messages. (P2·Q13a)

PART JSOON
C28CLASS
String vs char[] — and the Lab 6 runway

When an array of characters beats a String, conversion both ways, and the warm-up for Lab 6.

PART JSOON
L6LAB
Lab 6 · String programs

Everything Part J built, at the keyboard — pool experiments, builder benchmarks, method drills.

LAB 6SOON
PART K · C29–C32 · WRAPPERS · OBJECT · GENERICS · I/O
C29CLASS
Wrapper classes & autoboxing

Integer, Double & friends — why primitives need suits, parsing, caching surprises, and auto(un)boxing.

PART KSOON
C30CLASS
Object — the ancestor of everything

toString · equals · hashCode — the contract every Student record inherits, and why you override it.

PART KSOON
C31CLASS
Generics — type-safe boxes

<T> on classes and methods, bounded types, and the compile-time safety net. (P1·Q13a · P1·Q14a · P1·Q13b)

PART KSOON
C32CLASS
I/O basics — byte & character streams

InputStream vs Reader families, FileReader/FileWriter, and the Lab 7 runway. (P1·Q6 · P2·Q5)

PART KSOON
L7LAB
Lab 7 · Filter & buffered I/O

BufferedReader/Writer pipelines on Student record files — the P2·Q17a program lands here.

LAB 7SOON
PART L · C33–C36 · SERIALIZATION · UTILITIES · CLOSE
C33CLASS
Serialization — objects that survive shutdown

Serializable, the save-file idea, transient & serialVersionUID — Student CGPA objects on disk. (P2·Q13b)

PART LSOON
C34CLASS
ObjectOutputStream & ObjectInputStream

writeObject / readObject round-trips, casting on the way back, and what breaks the stream.

PART LSOON
C35CLASS
Process & Runtime

Talking to the JVM and the OS — mostly a guided self-study beat, kept in teaching sequence.

PART LSOON
C36CLASS
Unit 3 close — the full picture

Strings → wrappers → generics → streams → serialization stitched into one revision map, plus the Lab 8 runway.

PART LSOON
L8LAB
Lab 8 · Serialization

Save and restore whole Student objects — the unit's capstone at the keyboard.

LAB 8SOON

9 past-paper questions live inside this unit.

Part J carries P1·Q17a (StringBuffer vs StringBuilder) and P2·Q13a (String methods). Part K carries P1·Q13a, P1·Q14a and P1·Q13b (generics, incl. the toHex program) plus P1·Q6 and P2·Q5 (I/O). Part L carries P2·Q13b (serialization), and P2·Q17a lands as the Lab 7 program. Every one appears as a stepped model program inside its class — nothing is left "for revision later".