Question
JAVA :) Interface I { public abstract int yes(int b); } Abstract class A implements I{ public int w; public int x; public abstract int
JAVA :)
Interface I {
public abstract int yes(int b);
}
Abstract class A implements I{
public int w;
public int x;
public abstract int go();
public int yes(int b){
return (w*b( + x;
}
}
class B extends A{
public int y;
public int z;
public int go(){
return y * 10;
}
}
class C implements I {
public int c ;
public int yes ( int b ) {
return b + c;
}
}
BASED ON THE CLASS ABOVE CODE, ANSWER TRUE OR FALSE FOR THE QUESTIONS AND A BRIEF EXPLANATION
a) B objects may be used at type I
b) how many instance variables does a B object have (which ones are they)
c) no parent class exsists for C
d) in class B the three expressions x, this.x, and super.x all access the same variable
e) class B is not allowed to @override the yes method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started