Name:_______________________
Matric:_______________________
Course:_______________________
A. TRUE/ FALSE (5 Marks)
1. You can derive a new class from an existing class. This is called as class inheritance. (T/F)
2. The new class (derived class ) is called a superclass. The existing class is called child class.(T/F)
3. Constructors are a special kind of methods that are invoked to construct objects(T/F)
4. To override a method, the method must be defined in the derived class using the same signature as in its existing class.(T/F)
5. All method including a private method can be overridden.(T/F)
B. Design a class named person and its two subclasses named student and employee. A person has a name, address, phone, and email address. A student has a status. An employee has an department, salary and date hired.
Draw the UML diagram for the classes.
(10 Marks)
* untuk soalan B. 1. Bina Class (tak perlu buat program penuh) 2. Lukis UML.
pls submit before 5:00 pm.
Subscribe to:
Post Comments (Atom)
Cara download Installer windows 10 dalam format ISO
1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan. ...
-
ANSWERS TO CHAPTER EXERCISES (CHAPTER 8) Review Questions 1. List and describe various types of output, including technolog...
-
Based on real life scenario on any local company/ organization which you are very familiar, define the problem that could be addressed thr...
-
A. Response to the following statements by circling either T (TRUE) or F (FALSE). [10M] I. 1. Java enables users...
No comments:
Post a Comment