Main purpose of interface is to provide polymorphic behavior.
Just it is used to define some general information which can be used for specific purpose as we can define an interface with some attributes and method.
If anyone is searching in the future I'll leave a good example:
Lets say you get a request to aggregate calendars into one master calendar. This is actually a fairly common request and the common approach might be to create a MasterCalendar object that has many methods for every calendar. It might have a GetOutlookCalendar(DateTime start, DateTime end) and maybe a GetGoogleCalendar(DateTime start, DateTime end). This can end up being a monster class if down the road the requirements change from 2 calendars to 20 calendars. How do we fix this? Interfaces + Polymorphism.
Lets take out the common functions and add a few more objects to the equation and we'll end up with a pretty elegant solution. What both of those methods (and virtually all calendars) have in common is the GetEvents(DateTime start, DateTime end) so lets make that the interface:
Java has become the tool of mainstream programming from web to mobile world everything is now based on java.Java is a platform independent language that is used for various application development .The features of object oriented programming like polymorphism,. inheritance are indeed its core attributes but the concept of java byte code make it the winner as it provides the concept of platform independence.