Skip to lab content

B.Tech CSE & Allied Branches

Object Oriented Programming Lab

Learn Java through complete examples of objects, inheritance, interfaces, exceptions, threads, Swing and collections.

All experiment organized into 14 weeks. Each experiment includes its exact requirements, explanation, source, dry run, complexity reasoning and related viva answers.

14weeks28experiments168viva answers
Choose the correct run environment

21 experiments are standalone console programs. The scientific calculator uses four source files. Six Swing applications require a local JDK and desktop; their pages include rendered panel previews and interaction checks.

28 exercises

WEEK 01

Classes and constructors

01Library book catalog and constructorsConsole Java · source · line-by-line guide · flowchart · complexity · viva02Bank accounts and encapsulated operationsConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 02

Object records and result calculations

03Hospital patient records and thisConsole Java · source · line-by-line guide · flowchart · complexity · viva04Ten student results using an object arrayConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 03

Inner classes and string comparison

05Salary slips using a nonstatic inner classConsole Java · source · line-by-line guide · flowchart · complexity · viva06Three-attempt ATM PIN verificationConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 04

Inheritance and overriding

07Hierarchical inheritance for vehicle rentalsConsole Java · source · line-by-line guide · flowchart · complexity · viva08Payroll with overridden salary calculationsConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 05

Interfaces and packages

09Payment interfaces and runtime polymorphismConsole Java · source · line-by-line guide · flowchart · complexity · viva10Scientific calculator using Java packagesFour-file project · source · line-by-line guide · flowchart · complexity · viva

WEEK 06

Abstract classes and runtime binding

11Abstract media files and dynamic dispatchConsole Java · source · line-by-line guide · flowchart · complexity · viva12Shape interface and runtime bindingConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 07

Built-in exceptions and threads

13Integer division with multiple catch blocksConsole Java · source · line-by-line guide · flowchart · complexity · viva14Alternating odd and even threadsConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 08

User-defined exceptions

15ATM withdrawal with a checked exceptionConsole Java · source · line-by-line guide · flowchart · complexity · viva16Student results with custom validation exceptionsConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 09

Inter-thread communication

17Sender–receiver chat with wait and notifyAllConsole Java · source · line-by-line guide · flowchart · complexity · viva18Bounded producer–consumer order queueConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 10

Swing forms

19Swing course feedback formSwing desktop · source · line-by-line guide · flowchart · complexity · viva20Swing student registration formSwing desktop · source · line-by-line guide · flowchart · complexity · viva

WEEK 11

Swing selection and calculator

21Swing traffic light with exclusive selectionSwing desktop · source · line-by-line guide · flowchart · complexity · viva22Swing calculator using GridLayoutSwing desktop · source · line-by-line guide · flowchart · complexity · viva

WEEK 12

Mouse events and GUI exceptions

23Mouse listener and motion event explorerSwing desktop · source · line-by-line guide · flowchart · complexity · viva24Swing integer division with error dialogsSwing desktop · source · line-by-line guide · flowchart · complexity · viva

WEEK 13

Generics, lambdas and comparators

25Generic menu items and lambda discountConsole Java · source · line-by-line guide · flowchart · complexity · viva26Quiz leaderboard with chained comparatorsConsole Java · source · line-by-line guide · flowchart · complexity · viva

WEEK 14

PriorityQueue and maps

27Priority-based job schedulingConsole Java · source · line-by-line guide · flowchart · complexity · viva28Student marks database using HashMap and TreeMapConsole Java · source · line-by-line guide · flowchart · complexity · viva