(3 marks) Write a class User and a class SpecUser extending from User (i.e. User is a superclass and SpecUser is a subclass) with the following information:
User
Where:
2 of 2
Paper No: 8
-name:String
-status:int
+User()
+User(name: String, status:int)
+getName():String
+getStatus():int
+setName(name: String):void
+toString():String
SpecUser
-address:String
+SpecUser()
+SpecUser(name:String, status:int,
address: String)
+toString():String
Zoom
getName():String - return name.
getStatus():int-return status.
setName(name:String):void update name.
toString():String-return the string of format:name, status
Where:
toString():String return the string of format:
name, address, status
setData():void Append address string to the end of name string.
getValue():String - Check if the status=1 then return name + "admin" otherwise
+ 90%
Close