Course outline

CSE 202 Object Oriented Programming Lab — what the course covers and how it is organised, with every lab linked to its slide deck.

General information

CourseCSE 202 · Object Oriented Programming Lab · laboratory course
LanguageJava (JDK with NetBeans or another IDE)
Companion theoryCSE 201 Object Oriented Programming
MaterialsThe department’s Object Oriented Programming Lab Manual, ten lab manuals, each rebuilt here as an interactive deck

How each lab works

Each lab manual follows the same plan: objectives and prerequisites, the theoretical background, the implementation design, the complete source code with its expected output, a discussion of the results, in-lab tasks, and lab exercises submitted as a report.

Lab plan

LabTopicSlides
IJava Syntax, Data Types & Control Flow
Set up the JDK and an IDE, then write a first Java program that uses variables, primitive types, type casting, if/switch decisions and the three loops.
Open
IIClasses, Objects, Instances & Methods
Model a real thing as a class with private fields, a constructor and methods; create objects, use getters and setters, a static counter, and see two variables share one object.
Open
IIIConstructors, Overloading & Reference Passing
Give a Rectangle class default, parameterised and copy constructors chained with this(…), overload area() and describe(), and find out exactly what Java passes to a method.
Open
IVInheritance, Polymorphism & Overriding
Build a Vehicle hierarchy with Car, Motorcycle and ElectricCar: reuse code with extends and super, override display(), and let one loop drive every kind of vehicle.
Open
VAbstract Classes & Interfaces
Use an abstract Animal class for shared state and required behaviour, and the Drawable and Eatable interfaces for optional capabilities, then treat objects through both kinds of reference.
Open
VIException Handling & Custom Exceptions
Make a bank account that refuses bad input: throw and declare exceptions, catch them with try-catch-finally, write checked and unchecked custom exceptions and wrap low-level failures in a meaningful one.
Open
VIIThread Creation & Thread States
Create threads by extending Thread and by implementing Runnable, watch them move through NEW, RUNNABLE, TIMED_WAITING and TERMINATED, and protect a shared counter with synchronized methods.
Open
VIIISynchronization, Deadlock & Resource Allocation
Protect bank balances with synchronized methods and blocks, watch two transfers deadlock when they lock accounts in opposite order, and prevent it with lock ordering.
Open
IXGUI Components, Drawing, AWT & Swing
Build a Swing drawing application: a JFrame with layout managers, buttons and a colour box, event listeners, and a custom JPanel that draws rectangles and circles with Graphics.
Open
XAnimation with Threads
Animate bouncing balls: a worker thread updates positions about 60 times a second, a custom panel draws each frame with double buffering, and Start, Pause and Reset buttons control it.
Open

Lab exercises at the end of every manual are submitted as a lab report.