● What is an interface in Java and why would you, as a software developer,
use interfaces?
-They are an abstract type used to explain a behaviour a class must implement. They allow developers to make the coupling between classes very loose
● What is the difference between an abstract class and an interface?
-An abstract class is type that can be instantiated directly whereas an interfaces is explaining the implemented behaviours a class carries out
● Why is abstraction an important concept in software development and
what role do interfaces play in abstraction?
-It allows us to access object attributes and allows us to invoke behaviours of an object, lastly, it is important for encapsulation, inheritance and polymorphism
● What must a class do in order to implement an interface?
-Interface Test{}
-class Example implements Test{}
-This will allow class Example to implement the interface Test
● What is an abstract method?
-Method that can only be used by the abstract class with no body
● Can you instantiate an interface?
-No, Interfaces cannot be instantiated directly, However its members can be implemented by any class which implements the interface
● Can you declare a constructor inside an interface? If not, why?
-No, Interfaces cannot have constructers since interfaces allows default and static methods
● Can we override an interface method with visibility that is not public?
-No, we interface cannot override with a none public visibility. In the case of that visibility is public we can use the dame method signature to override the interface