Interface methods java abstract -
is true interface's methods abstract must override them? thanks. can't remember if interfaces abstract , require override. thank you.
leaving out new stuff introduced in java 8 complicates question, yes interface methods abstract. if have interface this...
public interface someinterface { public void methodone(); public void methodtwo(); } then class not compile.
public class someclass implements someinterface { } the code not compile because someclass not provide implementation of methods defined in someinterface.
the following class compile because provides implementatsion of interface methods.
public class someclass implements someinterface { public void methodone() { // ... } public void methodtwo() { // ... } }
Comments
Post a Comment