Multiple Choice Question

Quiz Guidelines

 

QID: 
45
Validated against: 
java7, java8
Question: 

Given interface Inter

interface Inter {
	
	void myMethod();
}

Which all implementations are valid?

A.

abstract class MyAbstract implements Inter{

    public abstract void myMethod();
}

B.

abstract class MyAbstract1 implements Inter{

    abstract void myMethod();
}

C.

abstract class MyAbstract2 implements Inter{

    void myMethod();
}

D.

abstract class MyAbstract3 implements Inter{

    void myMethod() {}
}

E.

abstract class MyAbstract4 implements Inter{

    public void myMethod() {}
}

F.

abstract class MyAbstract5 implements Inter{

    public abstract void myMethod() {}
}

G.

abstract class MyAbstract implements Inter{

    @Override
    public abstract void myMethod();
}

 

Q&A Set: 

Comments

The method in the interface Inter is not defined properly. The method should be static, default or abstract.

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!