Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Topic: Abstract Classes, Interfaces

Which is a valid method signature in an interface?


private int getArea();
protected float getVol(float x);
public static void main(String [] args);
boolean setFlag(Boolean [] test []);
Which statement is true about interfaces?
Interfaces allow multiple implementation inheritance.
Interfaces can extend any number of other interfaces.
Members of an interface are never static.
Members of an interface can always be declared static.
Which statement is true about interfaces?
The keyword extends is used to specify that an interface inherits from another
interface.
The keyword extends is used to specify that a class inherits from an interface.
The keyword implements is used to specify that an interface inherits from another
interface.
The keyword implements is used to specify that a class inherits from another class.
Which of the field declaration is legal within the body of an interface?
protected static int answer = 42;
volatile static int answer = 42;
int answer = 42;
private final static int answer = 42;
Which declaration prevents creating a subclass of a top level class?
private class Javacg{}
abstract public class Javacg{}
final public class Javacg{}
final abstract class Javacg{}

You might also like