aspose file tools
The moose likes Java in General and the fly likes Help please......... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Help please........." Watch "Help please........." New topic
Author

Help please.........

sunitha ravi
Greenhorn

Joined: Feb 16, 2001
Posts: 5
Hi,
I have class A and Class B (say)... class B has some methods that class A should use. But class A cannot inherit from B, B cannot be an abstract class or an interface....How do we do that?
all methods should be defined only in B, not allowed to be defined in A...any ideas?
Sunitha
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
How does it need to use the methods? Without code this is hard to answer.
You can make an instance of B inside A and then use the instance to get at the methods. (Is that what you mean???)


"JavaRanch, where the deer and the Certified play" - David O'Meara
Grant Crofton
Ranch Hand

Joined: Nov 08, 2000
Posts: 154
You could put the methods that both are to use in an interface and have both classes implement it.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Help please.........
 
Similar Threads
Constructor in Generic Class
Explain how it works so.
Has-a relationship
anonymous inner class question
static methods