This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes a basic java question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "a basic java question" Watch "a basic java question" New topic
Author

a basic java question

Abhi Venu
Ranch Hand

Joined: Jul 09, 2009
Posts: 73
class A
{
method(){ implmntn 1}
}

class B
{
method(){ implmntn 2}
}

class D
{
method(){ implmntn 3}
}


class myClass needs methods implemented by other three classes ,Not by creating a reference variable of these 3 in my class but by some other way. I know multiple inheritance is not allowed in java...yet i want to know

How can this be done in Java?


A table, a chair, a bowl of fruit and a violin; what else does a man need to be happy?:Einstein
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

You can't. You either need to create an instance of each class or make the methods static. The latter may not be possible if the method implements an interface method or overrides a method from a super class.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: a basic java question
 
Similar Threads
Collections Queries in Java.
Threads - Runnable vs. Extending Thread
ejb and file I/o
Threads Queries
Java Questions ??