File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regarding Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regarding Interface" Watch "Regarding Interface" New topic
Author

Regarding Interface

Sujittt Tripathyrr
Ranch Hand

Joined: Jun 21, 2006
Posts: 96
Why the Interface canot be static like

public static void display();

Thanks
sumeet saini
Greenhorn

Joined: Jun 01, 2006
Posts: 4
Hi,
Methods inside interface can't static, because these methods are implicitly public and abstract. And, modifiers 'abstrac' and 'static' can never come together.
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809

Why the Interface canot be static like

public static void display();


I did not get your question.

If you are asking why method declared in interface can't be static?

Then simple answer is interface methods are implicitly abstract. With abstract you can't combine any other non-access modifiers like static, synchronized etc. So they can't be static.

Naseem


Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Sujittt Tripathyrr
Ranch Hand

Joined: Jun 21, 2006
Posts: 96
Thanks Naseem

I cleared my doubts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding Interface