Quiz
MIssed itis questions
Questions in this quiz (4)
1Student inherits Person. Person has a private field named height and a public getter/setter method pair to access height. How may Student access height?
- ADirectly
- BdietField is private and may never be accessed by Dog
- CStudent inherits the public getter/setter methods. It may access Height through these methods.
- DStudent may access height through the setter but not the getter.
- EStudent may access height through the getter but not the setter.
2If Student inherits Person, what is the first thing that must happen within the Student constructor when a Student object is created? Assume Person does not have a default constructor.
- ACall the Person constructor
- BInitialize the required Student fields
- CCreate all objects required for Student fields
- DMap the parameters coming into the constructor to Student fields
3Person is a fully defined class with a method called getId(). You define a second class, Student which inherits Person, and you define a method in Student also called getId(). These two getId() methods have the same signature. Which getId() method would be called in the following code segment:
Student student = new Student();
Person person;
person = student;
person.getId();- AgetId() method of Person
- BgetId() method of Student
4Which of the following apply to both abstract Java classes and concrete Java classes?
- ABoth can be instantiated
- BBoth may contain concrete methods
Information
- Description
- Quiz on MIssed itis questions, created by A G on 04/05/2018.
- Author
- A G
- Language
- English
- Views
- 1
- Rating
- No ratings yet Rate this quiz