1.What is interface in java?
An interface is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods. Interfaces cannot be instantiated?they can only be implemented by classes or extended by other interfaces.
2.Can you declare an interface method static?
No
3.Can an interface be final?
No
4.What is marker interface?
Empty interface eg: serialization ,clonable
5.What is the difference between abstract class and interface?
Abstract:extends keyword used,need not to implement all methods,only one abstract class ca be extended
Interface:implement keyword used,must implement all methods,implement many interface.
6.Can we define private and protected modifiers for variable in interfaces?
No
7.When can an object reference be cast to an interface reference?
When a class implement an interface then a class object can be cast to the interface object.