This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

interfaces

 
Vinnie Jenks
Ranch Hand
Posts: 207
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic