A)
->An interface is a class like constructor of java language.
->”interface” keyword used to create an interface in java.
->An interface is compiled to “.class” file.
->An interface has variable & methods.
->A class can inherit from an interface.
->Reference variable (simply reference) can be created from an interface.
i.e. the interface reference is the user defined variable.
Ex:
interface I
{
}
class A {
public static void main(String[] args) {
I r;
}
}
->An interface acts as a user defined data type. So an interface is not a primitive.
Comments
Post a Comment