why use interface? if interface declear a method implement
in class. why direct implement method in class

Answer Posted / fajruddin sk

interface mainly use as of my knowledge-----> (1) for loosely coupling(2)just declare a rule(3)for giving a special behavior(Marker interface) (4)for multiple inheritance

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a serialized object be transferred via network?

510


What is the purpose of the wait(), notify(), and notifyall() methods in java programming?

572


How does sublist works in java?

538


Can we start a thread twice in java?

506


Why do we need variables?

529






Difference between ‘is-a’ and ‘has-a’ relationship in java?

533


Can a set contain duplicates?

515


What are the four integer types supported by java?

554


What is the difference between serializable and externalizable interface?

566


What language is an assembler written in?

547


Can you override private or static method in java?

547


What is a function argument in java?

513


What is string [] java?

524


What is pojo class in java?

534


How is string immutable in java?

539