aspose file tools*
The moose likes Beginning Java and the fly likes Specifying method signature for constructor in an interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Specifying method signature for constructor in an interface" Watch "Specifying method signature for constructor in an interface" New topic
Author

Specifying method signature for constructor in an interface

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

Is it a good move to specify the constructor in an interface ?

Pros vs cons ?


Regards,

Pho
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

I apologize but this is one stupid question, since an interface cannot share the same name as a implementation class. Ignore.
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
The compiler will not permit it.
However, I have seen many people attempt to do it.
What they really want is an accessor method on the interface.
In your example, you want:



Tony Morris
Java Q&A (FAQ, Trivia)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

Tony, can you explain?


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Specifying method signature for constructor in an interface