Which of the following correctly implements an interface with a method?

Last Updated :
Discuss
Comments

Which of the following correctly implements an interface with a method?

Java
interface Test { void method() {} } class Demo implements Test {} 


Java
interface Test { void method(); } class Demo implements Test { public void method() {} } 


Java
interface Test { void method(); } class Demo implements Test { void method() {} } 


Java
interface Test { void method(); } class Demo extends Test {} 


Share your thoughts in the comments