File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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.
I agree. Here's the link:
subject: interface
It's not a secret anymore!