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 is the generic function?

528


Explain the pointers in Java?

598


What are the types of inner classes (non-static nested class) used in java?

566


What is string pooling concept?

555


How to use Media tracker Class.

647






What are passing parameters?

588


What is the purpose of extern variable?

539


What are different access specifiers in java? Explain

628


Why do we need variables?

531


How will you get the platform dependent values like line separator, path separator, etc., ?

588


What are drawbacks of singleton class?

524


What is sorting algorithm in java?

527


What are the advantages of arraylist over arrays?

572


What is method overloading and method overriding?

538


How do you square a number in java?

558