Interface | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Interface

- Each method in an interface is also implicitly abstract, so the abstract keyword is not needed. - Methods in an interface are implicitly public. Each sentence talks about methods in an interface but one says they're abstract and the other says they're public ... so where's the truth ?

8th Jan 2017, 2:38 PM
Mark Alexa
Mark Alexa - avatar
1 Answer
+ 2
They are abstract AND public, both... A method can be public OR protected ( in some languages ) OR private ( in most languages )... but can be abstract in the same time. An abstract method, is a method declared, but which will be implemented in a class after inherit from the interface ( who's a kind of class you cannot instanciate, but you can only inherit ).
8th Jan 2017, 2:47 PM
visph
visph - avatar