aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Interface  methods Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Interface  methods" Watch "Interface  methods" New topic
Author

Interface methods

amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231

Hi everybody,

State true or false :
All methods of an interface are implicitly public, static, and final.

I think that it is false because if interface methods are final then they cannot be overriden. Also, it is not necessary for all the methods to be static.
Sam Zheng
Ranch Hand

Joined: Nov 29, 2000
Posts: 61
It is false.
All interface methods are implicitly public and abstract
(but not static!), while member variables in interface
are implicitly public static and final. In fact in the
exam I took last month, there was actually one question
asking these fine points.
Samrat Pujara
Greenhorn

Joined: Jan 06, 2001
Posts: 7
Methods of an Interface can't be final otherwise the class
which extends the Interface won't be able to use the method
and the purpose of Interface would be defeated.
Therefore , methods are public so that they are available everywhere
These methods are also abstract.
Arvind Kini
Ranch Hand

Joined: Dec 28, 2000
Posts: 31
yeah thats right
method of an interface cannot be final . I had come across this question in one of javeds chapter wise mock exams. there were many more of such wrong answers there . but then those were obvious wrong ones!!
regards
arvind
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Interface methods
 
Similar Threads
interface
Interface methods must not be static.
Abstract and interface
Some basic questions - part 2
package (default) access interface declarations