Exercise Number: 1
Instance Variable
Scenario: You are creating a class to represent a person. Each person has a unique ID.
Task:
- Create a class
Person
with an instance variablepersonId
to store the ID of the person. - Create a constructor to initialize the
personId
. - Create a method to display the person's ID.
- Create two objects of the
Person
class with different IDs and display their IDs.