☑Kizspy.me
3 of 4
Paper No: 1
(3 marks)
Write a class named Person and a class named Student extended from Person (i.e. Person is a superclass
and Student is a subclass) with the following information:
Person
Where:
-id: String
-name: String
-email: String
+Person()
+Person(id:String, name:String,
email:String)
+Getters & Setters
+toString():String
Person()-default constructor
• Person(id:String, name: String, email: String)-
parameterized constructor, which sets
values to id, name, and email. If the email is
invalid (missing@or dot) then set it to "N/A"
• Getters & Setters: write the setters and
getters of all the fields

toString(): String- return a string format that
contains all the information of the person: id,
name, email. The name is in uppercase
format.
Zoom
+100%
Close