Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
Interface
shashank dwivedi
Ranch Hand
Posts: 72
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
why variables inside interface are static while methods are not?
--
Shashank Dwivedi
sharma ishu
Ranch Hand
Posts: 70
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
because interface methods are abstract and you can't use static+abstract on a method.
Or you can say since static methods can't be overridden you must override a method in interface so you can't use static with interface methods.
Ramesh Pramuditha Rathnayake
Ranch Hand
Posts: 178
2
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can't make an object from
java
interface. Therefore, if the variable are not static, you can never refer them..!
You can't over-ride static methods. That's why we can't write 'static' abstract methods. Methods in an interface are implicitly abstract..
Ramesh-X
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Writing an Interface
Time Capsule
Regarding Interfaces
How To Call Two Different Classes From the Main Program Using the Same API?
Home interface or Home Interface stub
More...