This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "interface" Watch "interface" New topic
Author

interface

vanya khanduri
Greenhorn

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
(instances)
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
Steven
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
Home interface or Home Interface stub
Time Capsule
Writing an Interface
How To Call Two Different Classes From the Main Program Using the Same API?
what results byte code in java