why do we use interface in java?

Answer Posted / sandeep sagala

Interface is used to get an 100% abstract class. By using
this class we cant create an object for this class. In this
there will be all the unimplemented methods only. No method
is implemented in this type of classes. The methods present
inside this interfaces are all static and public by default.
The attributes present inside this interfaces are public,
final and static by default.

Is This Answer Correct ?    4 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have 2 main methods in java class?

755


What is the difference between yielding and sleeping?

790


What is the class in java?

760


Does sprintf add a null terminator?

828


What is an anonymous class in java?

784


How do you use nextline in java?

706


What are the difference between composition and inheritance in java?

743


What is a function in programming?

775


String class is defined under which package in java?

818


What Is Composition?

799


What is java regex?

747


What is data structure in java?

736


What is the symbol for space?

762


What is break and continue statement?

797


Why are the destructors for base class and derived class called in reverse order when the program exits

1941