SVKM’s NMIMS
Mukesh Patel School of Technology Management & Engineering /
School of Technology Management & Engineering
B. Tech/MBA Tech Lab and Workbook AY- 2025-26
Year:-First Subject:- Object Oriented Programming Lab Semester:-Second
Experiment: 7
PART B
(PART A: TO BE COMPLETED AND SUBMITTED BY STUDENTS)
Students must execute all the programs, write executed code in the workbook, and submit
part B of experiment 7 on the student portal. The filename should be
OOPL_batch_rollno_experimentno. Example: OOPL_A1_E001_E7
Roll No.: Name:
Prog/Yr/Sem: Batch:
Date of Experiment: Date of Submission:
Aim: Implement programs to demonstrate the use of inner classes
Problem Statement:
A smart home system has multiple devices, such as lights and fans, controlled by a remote.
Each remote has a power button to toggle the device on or off.
Tasks:
1. Create a class SmartHome that contains an inner class RemoteControl.
2. RemoteControl should have a method toggleDevice() that switches the device state
(ON/OFF).
3. Simulate controlling a device using the inner class.
Expected outcome:
Device is currently OFF
Turning ON the device...
Device is now ON
SVKM’s NMIMS
Mukesh Patel School of Technology Management & Engineering /
School of Technology Management & Engineering
B. Tech/MBA Tech Lab and Workbook AY- 2025-26
Year:-First Subject:- Object Oriented Programming Lab Semester:-Second
Executed Code, Input and Output
1. Implement programs to demonstrate the use of inner classes
Executed Code: -
// Paste the executed code here
Input Output: -
// Paste the input/output of executed code
Observation and Learning: -
- You should include your personalized concluding remarks aligned with the learning
outcomes outlined in PART A.
Question of curiosity:
1. What are inner classes?
2. Are private or static classes allowed? If so, how can they be implemented?