Question: These questions are java 1. Class Reply inherits from class Post. Write the header for class Reply (one line only). 2. Class Rectangle inherits from
These questions are java
1. Class Reply inherits from class Post. Write the header for class Reply (one line only).
2. Class Rectangle inherits from class Shape and interfaces Colors and Constants. Write the header for class Rectangle (one line only).
3. Here is interface I. public interface I {
public abstract void foo( ); }
Class C inherits from interface I. Code class C with a minimal implementation so that it is not abstract and it compiles (In other words, you do not require content inside curly braces.)
4. I is an interface, A is an abstract class, and B and C are regular classes. C inherits from B (i.e., B is the superclass of C). List all the errors and explain why they are errors.
A a = new A( ); // 1
B b1 = new B( ); // 2
C c1 = new C( ); // 3
I i = new I( ); // 4
B b2 = new C( ); // 5
C c2 = new B( ); // 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
