When we give defination of interface method in the class why
method must be public???

Answer Posted / pradeep singh

because class which implements the interfaces if the
access modifiers are protected or private then we can not
override this metods. somethos must be publicand java there
is notmultiple inheritance

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are daemon Threads in java?

724


How to set the permissions to a file in java?

615


when to use ArrayList and when to use HashMap in webApplication.

4024


Which of the classes will have more memory allocated?

638


Discuss 2D arrays.

703






Why is singleton not thread safe?

735


What is a stack class in java ?

707


Can vector have duplicates in java?

595


How many types of threads are there in java?

608


What is abstraction in java?

697


What is t in parametric equations?

637


Can I learn java without any programming experience?

673


Can a class be final?

582


What about instanceof operator in java?

680


What is unmodifiable collection in java?

593