java - Is a class that implements an interface also an interface? -
java - Is a class that implements an interface also an interface? -
i under impression when class implements interface implementing abstract methods, hence making them usable, non-abstract, methods. boss contends class implements interface interface. not create sense me. class implementing interface not abstract , not labelled interface. can give input on this?
a class not interface.* doesn't alter because class implements interface.
however, instance of class implements interface, instance of interface.
the big difference, , 1 seems miscommunicated here, difference between classes , objects.
let's have code:
public interface animal { } public class dog implements animal { public static void main() { animal rover = new dog(); } } there things can , can't relationship between stuff defined here.
we can (assuming "is (a/an)" short "is instance of"):
"adog animal." "rover dog." "rover animal." "dog (subtype/subclass/implementation) of animal." "dog (presents/provides/implements) interface."* we can not say:
"dog interface." (no, dog class.)* "dog animal." (see above. note difference between "dog" , "a dog".) * semantic pov, argued every class interface. argument has nil interface keyword; relies on traditional definition of word. , apply all classes, regardless of whether class implements someinterface.
java class interface
Comments
Post a Comment