Course home
OOP THROUGH JAVA UNIT V · UI24PC320CS JDK 21
5UNIT

12 classes · 4 labs · 10 PYQs · course close

Lambdas, streams & regex.

The modern-Java finale — lambda expressions and the four functional interfaces · method references and the great Unit-4 Comparator rewrite · Stream pipelines (filter · map · collect) · regex with Pattern & Matcher · JavaBeans — then the whole course closes.

PART P · C49–C52 · LAMBDAS + FUNCTIONAL INTERFACES LAB 12 · LAMBDA FUNCTIONS PART Q · C53–C56 · STREAM API LAB 13 · STREAM API PART R · C57–C60 · REGEX + JAVABEANS + CLOSE LAB 14 · REGEX LAB 15 · INTEGRATED REVISION

THE ROADMAP · C49 → C60

Twelve classes. Four labs. The course's final round.

Part P collapses your hand-written Comparators into lambdas on the Student CGPA spine. Part Q chains Stream pipelines on place / delivery-order dashboards. Part R validates Indian input shapes (mobile · PAN · roll number) with regex, formalises JavaBeans — and closes the entire course. Labs 14 and 15 both land after C60, in that order.

PART P · C49–C52 · LAMBDAS, FUNCTIONAL INTERFACES & METHOD REFERENCES
C49CLASS
Why Java needed lambdas + functional interfaces

You wrote a whole class to compare two cars — Java 8 does it in one line. Lambda syntax and the one-abstract-method rule. (P1·Q9)

PART PSOON
C50CLASS
Predicate · Function · Consumer · Supplier

Four interfaces cover almost every lambda you'll ever write — matched to real scenarios. (P2·Q10 · P2·Q15a)

PART PSOON
C51CLASS
Method references + the Unit-4 Comparator rewrite

The :: shorthand's four forms — then the payoff: your own Lab-11 Comparator collapses into one line, piece by taught piece.

PART PSOON
C52CLASS
Lambda factorial + the Lab-12 runway

The full toolkit at work on a real exam question, plus the Student CGPA domain the lab will use. (P1·Q15a)

PART PSOON
L12LAB
Lab 12 · Lambda functions

Student CGPA sort with a lambda Comparator + LambdaSuite — factorial, even/odd, greeter in one file.

LAB 12SOON
PART Q · C53–C56 · THE STREAM API
C53CLASS
What a Stream is + creating one

Not a data structure — a pipeline: source → reshape → finish. Declare what you want, not how to loop for it.

PART QSOON
C54CLASS
Intermediate ops — filter · map · sorted · distinct

Reshaping the pipeline before it produces anything — powered by the Predicate and Function you met at C50.

PART QSOON
C55CLASS
Terminal ops — collect · reduce · forEach

The op that finally makes the pipeline run — toList, groupingBy, counting, and the spent-stream rule. (P1·Q10)

PART QSOON
C56CLASS
Stream PYQs — the Nepal filter + three-ops roundup

Two exam questions answered live, then Part Q closes into the Lab-13 runway. (P1·Q15b · P2·Q17c)

PART QSOON
L13LAB
Lab 13 · Stream API

PlaceFilter (the exam's own Nepal pipeline) + delivery orders grouped and counted by city.

LAB 13SOON
PART R · C57–C60 · REGEX · JAVABEANS · COURSE CLOSE
C57CLASS
Regex basics — Pattern, Matcher, syntax

A tiny language for describing the shape of a string — tokens, quantifiers, anchors, classes. (P2·Q9)

PART RSOON
C58CLASS
Regex PYQs — PAN validation + lowercase-to-front

Two exam-graded regex problems built from yesterday's pieces; the regex block closes here. (P1·Q17c · P2·Q15b)

PART RSOON
C59CLASS
JavaBeans architecture

A class that follows one convention so every tool can read it — no-arg constructor, private fields, getters/setters, Serializable.

PART RSOON
C60CLASS
Unit-5 close + course close + career next

The whole five-unit map front to back, fresher-interview warm-up, and the road that starts here — Spring Boot, Android, beyond.

PART RSOON
L14LAB
Lab 14 · Regular expressions

Mobile-number and PAN validators — both real exam questions, verbatim. Needs only the regex content finished by C58.

LAB 14SOON
L15LAB
Lab 15 · Integrated revision — the final session

No new topics — lambda, Stream and regex revised together in one cross-topic close to the whole course.

LAB 15SOON

10 past-paper questions live inside this unit.

Part P carries P1·Q9 (lambda ↔ functional interface), P2·Q10 (even/odd lambda), P2·Q15a (functional-interface example) and P1·Q15a (lambda factorial). Part Q carries P1·Q10 (intermediate vs terminal), P1·Q15b (the Nepal filter) and P2·Q17c (any three Stream ops). Part R carries P2·Q9 (mobile-number regex), P1·Q17c (lowercase-to-front) and P2·Q15b (PAN validator). Every one appears as a stepped model program inside its class, and the two regex validators land again as Lab 14's exercises verbatim.