PRO192_-_PE02_-_SP_2025_3836.webp
Q

PRO192_-_PE02_-_SP_2025_3836.webp

☑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
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
Quốc Khánh1
Ngày thêm
Lượt xem
1,359
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom