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

Interface Help

Channy
Greenhorn

Joined: Nov 18, 2002
Posts: 13
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

Joined: Jan 10, 2002
Posts: 61623
    
  67

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Channy
Greenhorn

Joined: Nov 18, 2002
Posts: 13
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

Joined: Jul 08, 2003
Posts: 24187
    
  34

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interface Help