aspose file tools*
The moose likes Java in General and the fly likes interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "interfaces" Watch "interfaces" New topic
Author

interfaces

Vinnie Jenks
Ranch Hand

Joined: Apr 26, 2004
Posts: 207
I'm a long-time C# cat trying to translate my skills over to Java.

In C#, when I create an interface I can use it as a means of declaring a type in an abstract manner, like so:



Does it work this way in Java? I'm using Eclipse and it's telling me it can't find my interfaces as types...is this just an Eclipse issue?

I tried this:



If this is a Java "gotcha", are abstract classes the same?

Thanks!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Your example Java code is exactly right; the devil is in the details, though, so perhaps some detail is wrong in your real code. Maybe it's a package thing? Make sure the package containing the interface is imported when you compile your other code (assuming everything's not in one package.)


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interfaces