12 classes · 3 labs · 14 PYQs
Access modifiers · encapsulation, the fourth pillar · Singleton & nested classes · interfaces deepened & packages · the exception hierarchy, try/catch/finally & your own exceptions · threads, the lifecycle, synchronization & deadlock. A canteen card, a campus Wi-Fi login, a food-ordering app's crash logs, and two students racing for the last movie ticket.
THE EXACT SESSION ORDER — FOLLOW IT TOP TO BOTTOM
Strict four-classes-per-lab, exactly as the knowledge doc plans it — LAB 3 lands after Class 16, LAB 4 after Class 20, LAB 5 after Class 24. Sessions unlock as they are authored; everything below is dimmed until its page goes live.
private · default · protected · publicWho can see what across a Java codebase — all four levels, the full visibility matrix, and a CampusEventApp walkthrough. PYQs P2·Q11a and P1·Q12b solved in place.
A CanteenCard whose balance can never go negative — getters/setters with validation, the immutable-class recipe, and four PYQs landing here (P1·Q5 · P1·Q11a · P1·Q11b · P1·Q16a).
The campus Wi-Fi enforces one active login per roll number — that's why Singleton exists. Private constructor + getInstance(), then the four kinds of nested class. PYQs P2·Q12a (abstract Reservation) and P1·Q4 (private constructor).
Java 8 default & static methods, marker interfaces, the VasaviLibrary PYQ (P2·Q16b) — then com.college.attendance built both in Eclipse and by hand with javac -d.
Syllabus Lab 3 — a two-package campus-attendance app: AttendanceCalculator in com.college.attendance, driven cross-package by Main, compiled with javac -d.
A campus food-ordering app's real crash logs become the source of every example — Throwable → Error / Exception → RuntimeException, and PYQ P2·Q4 on checked vs unchecked.
try/catch/finally · multi-catch · throw vs throwsA movie-ticket counter holds a seat that must be released on both the success and failure paths — that's what finally is for. PYQ P1·Q3 on multiple catch blocks.
How an error travels up the call stack, how to read the trace the JVM prints, and your first custom exception — OutOfStockException in the food-ordering cart.
Three exam questions answered in one class — InvalidAgeException (P2·Q12b), the banking multi-catch (P1·Q16b), the insurance hierarchy (P1·Q12a) — then chaining, best practices, and the cheat sheet.
Syllabus Lab 4 — InvalidAgeException with a re-prompt loop, then the BankAccount[] multi-catch/throws/finally build. Both PYQs' real-world forms.
Process vs thread, why apps need both a live map and an updating order status — then the two ways to make one: extends Thread vs implements Runnable, and which is generally better.
start() vs run() — the classic mistake — then the five states between NEW and TERMINATED, sleep()/join(), priority as a hint not a guarantee, and interruption.
synchronized · volatileTwo students book the last seat at the same instant — the MovieTicketCounter race, unsynchronized vs synchronized bookTicket() side by side. PYQ P2·Q3 on why synchronization matters. Feeds Lab 5 directly.
wait()/notify(), producer–consumer, the classic two-lock deadlock and how to prevent it — then the honest four-pillar teach-back, now that encapsulation is truly in hand.
Syllabus Lab 5 — MovieTicketCounterUnsafe vs MovieTicketCounterSafe: Diya's and Rohit's booking threads race for one ticket, the overbooking bug appears on screen, then synchronized provably fixes it.
Every PYQ is solved on a ruled notebook sheet, point by point — from P2·Q11a (access specifiers) at Class 13 to P2·Q3 (thread synchronization) at Class 23 — and each is elaborated beyond its marks weightage so no re-skin can surprise you. Two of them land twice: their exam form in class, their real-world form again in Lab 4.