What is the use of interface in realtime java project ?

Questions by Raman KD

Showing Answers 1 - 9 of 9 Answers

Yeswanth

  • Dec 6th, 2013
 

To hide coding to end user and for security reasons we will use interface and initialization also not required for interfaces.

  Was this answer useful?  Yes

Sumit Thakkar

  • Feb 6th, 2014
 

Interface allows to various design patterns, encapsulate the changing parts. some design patterns totally rely on interfaces for dynamically assigning the objects to perform functionality without major change in the code.

  Was this answer useful?  Yes

prabhu.S.R

  • Feb 16th, 2014
 

To import many subclasses.

  Was this answer useful?  Yes

ashokvenna

  • May 28th, 2014
 

Using Interface ,we can easily share the Data between applications,bcause interface has by default public and abstract methods,so any body can implement that methods must and should.And Interface supports Multiple Inheritance concept,but java classes not support that feature.Very important its sharebility of data and using of Future enhancement.Here,in Abstract class also using same purpose like interface.But interface is fully abstract oriented,but Abstract class not that fully.and abstract class not support multiple inheritance.

see the difference in abstract class and interface(in abstract class we must declare public and abstract keybords but not in interface)

Code
  1. interface Student{

  2.  

  3. void register(StudentJB sjb);//by default public abstract

  4. }

  5.  

  6.  

  7. public abstract class Student{

  8.  

  9. public abstract register(StudentJB sjb);

  10. }

  Was this answer useful?  Yes

Anjan

  • Jan 2nd, 2015
 

By Using Interface Useful contract between two applications like client and server

  Was this answer useful?  Yes

yura

  • Dec 2nd, 2015
 

Interfaces are used more like contracts that enforce the user to implement features so that you can develop a functionality knowing the person who is going to use the API will always implement certain methods are parameters as you expect. And like others said it makes multiple inheritance possible.

  Was this answer useful?  Yes

Sukhrob

  • Dec 24th, 2015
 

So interfaces could be used if only if you are sure that the API will not be changed, because when you want to add some new method headings in interface you will have to change all the classes which implement that interface.
Since JAVA doesnt have multiple inheritance A class can implement several interfaces

  Was this answer useful?  Yes

meena

  • Feb 16th, 2016
 

Consider a construction of a building. The basic entire PLAN of the building I what an INTERFACE does. Next, the implementation of that PLAN is done by CONCRETE methods. If some of the work is done and still some is left is what ABSTRACT method/class does.

  Was this answer useful?  Yes

Interface is majorly supported for IS-A relationship ie; Inheritance. Writing an interface is similar to writing a class. But a class describes the attributes and behaviours of an object. And an interface contains behaviours that a class implements. And it provide simple PLAN for creating a structure of objects and its co-relations.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions