Q1_20251109103741.webp
May76

Q1_20251109103741.webp

  • Media owner May76
  • Ngày thêm
hoa nguyen, 5.4
Question 2:
(3 marks) Write a class Car and a class SpecCar extending from Car (i.e. Car is a superclass and
SpecCar is a subclass) with the following information:
-color:String
-seat:int
Car
Where:
getColor():String- return color.
getSeat():int-return Seat.
2 of 2
+Car()
Paper No: 3
+Car(color:String, seat:int)
+getColor():String
+getSeat():int
+setColor(color:String):void
⚫ setColor(color:String):void - update color.
⚫ toString(): String-return the string of format:
color, seat
+toString():String
Zoom
- FUO
SpecCar
-model:String
+SpecCar()
+SpecCar(color:String, Seat:int, model:String)
+getModel():String
+toString():String
+ 100%

Where:
toString():String return the string of
format:
color, seat, model
⚫ getModel():String return model.
.setData():void - Remove the first letter
in the color string.
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
May76
Ngày thêm
Lượt xem
508
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom