189k views
3 votes
Assuming that interface Resizable is declared elsewhere, consider the following class declaration:

public class InnerClassExample
{
public static void main(String[] args)
{
class SizeModifier implements Resizable
{
// class methods
}
__________________________ // missing statement
}
}
Which declarations can be used to complete the main method?

1 Answer

3 votes

Answer:

The answer is "Resizable something = new SizeModifier();".

Step-by-step explanation:

In the given code a class "InnerClassExample" is defined, inside the class the main method is declared, in which a class "SizeModifier" is declared, that inherits the interface, that is "Resizable".

  • Inside of the main method, we create an interface object, which is "something", in which the "SizeModifier" class is used to call as an instance or constructor.
  • In this question only answer section code is correct, and others were wrong because it is not declared in the question.
User Jojo Joseph
by
5.4k points