Question: in java Is the following class legal? Please explain why it is legal or not legal in addition to the answer Choose the correct reason

in java

Is the following class legal? Please explain why it is legal or not legal in addition to the answer

Choose the correct reason why or why not

abstract class Cousins

{

abstract void a();

public void b()

{

a();

System.out.println("b"); }

}

a) Yes- we'll have an a() method once we have an object from a conrete child class

b) no- concrete methods cant call abastract methods from the same class

c) no- though a chid class must provide a(), its signature might change.

d) no-the child class might also be abstract

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!