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 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 "interface" Watch "interface" New topic


vanya khanduri

Joined: Jan 23, 2001
Posts: 3
can a method in an interface be declared static??? why???
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
They can be but they implicitly static

Val SCJP <BR>going for SCJD
Stephen Joseph
Ranch Hand

Joined: Dec 29, 2000
Posts: 50
Methods in the Interface are abstract implicitly and they have to be implemented in some class which will be accesed by objects
By making the methods static we mean that it belongs to a class and not any instances and so I think that both abstract and static cant be used together as it will defy the purpose of the interfaces(to be implemented by classes)

Thank you
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
i made a mistake interface mmethods cannot be static becaue object must implement them.
Consider Paul's rocket mass heater.
subject: interface
Similar Threads
How To Call Two Different Classes From the Main Program Using the Same API?
Home interface or Home Interface stub
Time Capsule
Writing an Interface
what results byte code in java