statement based on this situation. a. The class Staff is allowed to have ONLY abstract method(s). b. We can create objects/ instances from the class Staff c. The class Part TimeStaff MUST impelement the method calculateSalary() in its class.
[INHERITANCE] String name; Based on this declaration, name is an instance variable that has been declared in the class Person. The class Person also is a superclass for class Employee. The class Person is created in the package of registration, while the class Employee is created in the package of maintenance. Which is the CORRECT answer of accessing the variable of name. a. The variable name ONLY can be accessed in the class Employee. b. The variable name can be accessed ONLY in the class Person c. The variable name can be accessed in any classes from any packages. d. The variable name can be accessed in any classes in the package of registration.
[INHERITANCE] Choose the CORRECT statement of method super().(hint:Do not refer to super().methodName) a. method super()will call subclass's constructor. b. method super()can be written in any rows in any constructor. c. method super()can be called in any method. d. method super()must be written in a first row in a subclass's constructor.
[INHERITANCE] protected double salary; Based on this declaration, salary is an instance variable that has been declared in the class Person. The class Person also is a superclass for class Employee. The class Person is created in the package of registration, while the class Employee is created in the package of maintenance. Which is the INCORRECT(FALSE) answer of accessing the variable of staffNo. a. The variable salary can be accessed in any classes in the package of registration. The variable salary can be accessed in the class Person b. c. The variable salary can be accessed in the class Employee. d. The variable salary can be accessed in any classes from any packages other than the both packages
[INHERITANCE] Assume that we have two classes namely Staff and Part TimeStaff. The class Staff is an abstract class. There is an abstract method named calculateSalary() in the abstract class. While, the class PartTimeStaff is a sub class of the class Staff. Choose the CORRECT [INHERITANCE] Assume that we have two classes namely Staff and Part TimeStaff. The class Staff is an abstract class. The
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am