subject

Consider the following interface & class definitions.

public interface ClassA

{

public void methodA();

}

public class ClassB implements ClassA

{

public void methodA() { /* ... some code ... */ }

}

public class ClassC extends ClassB

{

public void methodC( ClassC obj ) { /* ... some code ... */ }

}

Consider the following statements in a client class.

ClassC objC = new ClassC();

ClassB objB = new ClassB();

Which of the following method calls would be permissible?

objB. methodC(objC);

objC. methodC(objB);

objC. methodA();

Answers:

A.

I only

B.

II only

C.

III only

D.

II and III only

E.

I, II, and III

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:10, drelisech6467
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, tchloe448
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, jaymc1932
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
image
Computers and Technology, 23.06.2019 19:30, bevanscory123
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
Consider the following interface & class definitions.

public interface ClassA
...

Questions in other subjects:

Konu
Chemistry, 08.11.2020 17:30