Core Java Interview questions on Java interface

Core Java Interview questions on Java interface

1. Can an Interface be defined inside a class ?
2. What is a Marker Interface ?
3. Can Interface be absolutely blank ? What is the use of such an interface ?
4. When can an object reference be cast to an interface reference ?
5. Can we instantiate an interface ?
6. Can anonymous class be declared as implementing an interface and extending a class ?
7. What is interface ?
8. Can you inherit the interface in Java ?
9. Class ABC implements Interface containing method m1 and m2 Class ABC has provided implementation for method m2 Can you create object of Class ABC ?
10. Can method inside Interface be declared as final ?
11. Can Interface implement another Interface ?
12. Can Interface extend another Interface ?
13. Can Class extend more than one Class ?
14. Why Interface can extend more than one Interface but a Class can’t extend more than one Class ?
15. Can Interface be final ?
16. Can class be defined inside an Interface ?
17. What modifiers are allowed for methods in an Interface ?

Check out all interview questions:

 

Leave a Reply

Your email address will not be published. Required fields are marked *