Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
Beginning Java
Java interface
Vijay Chandran
Ranch Hand
Posts: 186
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Dear Friends,
While implementing an interface is it possible to give the implemented method as final in the implementing class?
interface A { void methodA(); }
class B implements A { public final void methodA() { // Is this possible? //Implementation Code } }
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
Rancher
Posts: 43081
77
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Why wouldn't it be allowed?
Vijay Chandran
Ranch Hand
Posts: 186
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 22803
131
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
So I left, I came home, and I ate some pie. And then I read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Testing of data class instance(s)
Interface
abstract class inplementing an interface
how to prevent overriding method?
Low coupling??
More...