Question: Given the following class declaration, which options correctly declare a local variable containing an instance of the class? A. new Sunset() extends Sky {}; B.
Given the following class declaration, which options correctly declare a local variable containing an instance of the class?

A. new Sunset() extends Sky {};
B. new Sky();
C. new Sky() {}
D. new Sky() { final static int blue = 1; };
E. The code does not compile regardless of what is placed in the blank.
F. None of the above.
public class Earth { } private abstract class Sky { void fall() { var e= } }
Step by Step Solution
3.45 Rating (174 Votes )
There are 3 Steps involved in it
The image depicts a snippet of Java code for a public class named Earth which contains a private abs... View full answer
Get step-by-step solutions from verified subject matter experts
