aspose file tools*
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
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: 42264
    
  64
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: 19718
    
  20

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