Interference
Interference
And child class c want to implement that method by default java doesn’t support multiple
inheritance , this can be achieved using interference
in abstract class at least you can define a method but in interface you cannot define method
suppose we have a child method display and we cannot create obj for interface but we can create
reference
Here obj.show() will work and obj.display() not work as display doesn’t belong to B class , here I am
restricting user form using display .This is the use of interface
Why it is needed
Now we want to assign permission to class DEMO to print hello we don’t want every one to access it
now we are creating a interface p with no declaration and implementing class DEMO with p .