This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java interface" Watch "Java interface" New topic
Author

Java interface

Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 178
Dear Friends,

While implementing an interface is it possible to give the implemented method as final in the implementing class?





Because in the eclipse editor this is not giving any compiler error. If this is possible why this is allowed?

Thanks & Regards,
Vijay
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41124
    
  45
Why wouldn't it be allowed?


Ping & DNS - my free Android networking tools app
Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 178

interface methods are implicitly public / abstract. So i couldn't understand the concept of allowing final in the implementation of public / abstract method.


Kindly provide me a clarification.

Thank you very much.

Regards,
Vijay
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19654
    
  18

They're abstract in the interface. As soon as they are implemented they are no longer abstract in the implementing class.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java interface
 
Similar Threads
Testing of data class instance(s)
abstract class inplementing an interface
how to prevent overriding method?
Interface
Low coupling??