why do we use interface in java?

Answer Posted / guest

Interface is a collection of abstract classes n
methods.Interface is mainly used for restricting the users
to make use of the specified methods only.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between exception and error in java?

490


Can extern variables be initialized?

509


What is the meaning of immutable regarding string?

519


How do you calculate square roots?

577


What’s a deadlock?

607






When is finally block not called?

580


Is hashset ordered java?

587


What is difference between static class and normal class?

529


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

553


What is use of valueof () in java?

555


What is the difference between reader/writer and inputstream/output stream?

553


How to create an interface?

625


What are the differences between wait() and sleep()?

538


What sorting algorithm does javascript use?

526


Does printwriter create a file?

538