Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9. Which of the following statements about polymorphism are true? (Choose all that apply) An object may be cast to a subtype without an explicit

image text in transcribed

9. Which of the following statements about polymorphism are true? (Choose all that apply) An object may be cast to a subtype without an explicit cast. If the type of a method argument is an interface, then a reference variable that implements the interface may be passed to the method. A method that takes a parameter with type java.lang.Object can be passed any variable. All cast exceptions can be detected at compile-time. By defining a final instance method in the superclass, you guarantee that the specific method will be called in the parent class at runtime. Polymorphism applies only to classes, not interfaces. 10. Which of these classes compile and will include a default constructor created by the compiler? (Choose all that apply) public class Bird \{\} public class Bird \{ public bird() ff \} public class Bird { public bird(String name) \{\}} public class Bird \{ public Bird() }}} public class Bird { Bird(String name) \{\}} public class Bird { private Bird(int age) \{\}} public class Bird { public Bird bird() \{return null; }} 11. Which statements about polymorphism and method inheritance are correct? (Choose all that apply) It cannot be determined until runtime which overridden method will be executed in a parent class. It cannot be determined until runtime which hidden method will be executed in a par- ent class. Marking a method static prevents it from being overridden or hidden. Marking a method final prevents it from being overridden or hidden. The reference type of the variable determines which overridden method will be called at runtime. The reference type of the variable determines which hidden method will be called at runtime. 12. Which of the following statements about abstract class are true? (Choose all that apply) Abstract class is a hybrid of concrete class and abstract interfaces. Abstract class can be initiated itself. Abstract class cannot have attributes. Abstract method is only allowed to be in abstract class. Abstract method must be implemented. Abstract class can extend from a superclass and implement multiple interfaces

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

Students also viewed these Databases questions