Question 11
Given: And given the code fragment: Book book1 = new EBook(); book1.readBook(); Which option enables the code to compile?
- Option A
- Option B
- Option C
- Option D
Question 12
Given: What is the result?
- A B C D
- A C D
- A C D D
- A B D
- A B D C
Question 13
Given: Which code fragment should you use at line n1 to instantiate the dvd object successfully?
- Option A
- Option B
- Option C
- Option D
Question 14
Given the code fragment: Which option can replace xxx to enable the code to print 135? A. B. C. D.
Question 15
Which statement best describes encapsulation?
- Encapsulation ensures that classes can be designed so that only certain fields and methods of an object are accessible from other objects.
- Encapsulation ensures that classes can be designed so that their methods are inheritable.
- Encapsulation ensures that classes can be designed with some fields and methods declared as abstract.
- Encapsulation ensures that classes can be designed so that if a method has an argument MyType x, any subclass of MyType can be passed to that method.