Midterm OOP
Midterm OOP
Interface
- Offers a way for unrelated classes to implement a set of
common methods. Interface specifies what operations a
radio must permit users to perform but does not specify how
the operations are performed. Java interface describes a set
of methods that can be called on an object.
- It does not make sense if you have is-a for everything, so
you can use interface to link your classes
- Interface is a list of public implemented methods
- Interface may not specify any implementation details such
as concrete method declarations and instance variables
- Interface declarations begins with the keyword interface and
contains only constants on abstract methods
- All of the interface members by default must be public
- All fields are implicitly public static and final superclass….