Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are told that class C is a subclass of AC . Therefore, how many of these 1 4 numerated statements are valid? public interface

You are told that class C is a subclass of AC. Therefore, how many of these 14 numerated statements are valid?
public interface I{
int i =8;
public int getVal();
}
public abstract class AC implements I {
public abstract int getNum();
}
public class MyProg extends AC{
public static void main(String[] args){
System.out.println(I.i);
I.i =10;
I i1= new AC();
I i2= new C();
System.out.println(i2.getVal());
System.out.println(i2.getNum());
C c1= new I();
C c2= new AC();
System.out.println(c2.getVal());
AC ac1= new AC();
AC ac2= new C();
System.out.println(AC.i);
System.out.println(ac2.getNum());
System.out.println(ac2.getVal());
}
}

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

Question Completion Status Quinto 3 5 B 2 w T A 5 K. L S. F N M Z X

Answered: 1 week ago