Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface Help

 
Channy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I need help with a homework question.
I created the following interface:

I'm trying to reference either PowerOn or FixWindow from another class using (although I'm supposed to return a Fixable type..):

I've also tried:

I keep getting the error: "Cannot find symbol: PowerOn()"
I've made sure to add the the package name at the top of the interface file and import all files from the package.. Any Help would be wonderful!!
[ June 19, 2007: Message edited by: geek_azoid ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"geek_azoid",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would try your second alternative again, because it's correct and should work fine, as long as your second class has access to the Fixable interface.
 
Channy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Thanks for your reply!

When you say "access to Fixable interface" do you mean by importing the package, or something else?

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by geek_azoid:
you say "access to Fixable interface" do you mean by importing the package


Really I mean that if Fixable is in a different package, then it must be public. importing just changes the syntax you can use -- whether you need to specify the package name along with the class name.
[ June 19, 2007: Message edited by: Ernest Friedman-Hill ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic