What is interface and its use?

Answer Posted / guest

Interface is similar to a class which may contain method's
signature only but not bodies and it is a formal set of
method and constant declarations that must be defined by
the class that implements it.
Interfaces are useful for:
a) Declaring methods that one or more classes are expected
to implement
b)Capturing similarities between unrelated classes without
forcing a class relationship.
c)Determining an object's programming interface without
revealing the actual body of the class.

Is This Answer Correct ?    15 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is oracle charging for java?

532


Do I need java on my pc?

495


Why is boolean important?

575


Is stringwriter thread safe?

540


Is java 11 paid version?

495






Does java isempty check for null?

557


How many bytes is a string in java?

519


What is difference between java and java ee?

543


what is difference between equals and ==?

575


What is the collections api in java programming?

541


Difference between method overloading and overriding.

568


What is compareto () in java?

529


Is there any tag in htm to upload and download files?

592


What is final class?

565


How many functional interfaces does java 8 have?

591