While not very common an interface in Java can contain a class. Most interface definitions strictly provide an interface and don't include inner classes.
An example is the java.text.AttributedCharacterIteratorinterface found in the J2SE API which includes a public static inner class Attribute. The inner class is accessed externally as AttributedCharacterIterator.Attribute.
Differences:Abstract class can also contain method definitions but an interface can contain only declarationsAll variables in an interface are by default public static and final whereas in Abstract class it is notAn interface can be considered as a pure abstract class that contains no method implementations and contains only declarations.
The idea is that an interface is not a class, it is just a specification of what classes that implement it must contain.
Dictionary, Hashtable ,Properties ,Stack and vector are the legacy classes in java
classes can be extended and interfaces can be implemented.
In Java, an interface is a suite of methods that multiple different classes are able to implement. Interfaces are not assigned to any particular class. For example, multiple graphics classes can use the same interface to change their size and colour.
The BIOS tells the system how to interface with certain devices in the computer.
Every Computer on a network contains an NIC(Natwork Interface Card). Sajid(Australia)
While neither abstract classes nor interfaces can be instantiated in Java, you can implement methods in abstract classes. Interfaces can only define methods; no code beyond a method header is allowed.
Interfaces are a way of imposing a type of functionality on all other java classes that are created using it. It is kind of a template that all child classes using this template must follow. All methods that are declared in an interface must be implemented by the child classes and hence the functionality offered by these classes can be controlled using them. Interfaces are a powerful tool that java provides to achieve multiple inheritance.
South Bridge
South Bridge
A class is a data type. An interface consists of the private, protected and public members of a class, allowing consumers of the class to interact with the class representation in a controlled manner. The private interface is only accessible to the class itself and to friends of the class. The protected interface is similar to the private interface but is also accessible to derivatives of the class. The public interface is fully accessible. The private and protected interfaces are intended purely for use by the class implementers while the public interface is intended for use by both consumers and implementers.