Originally posted by j srinivas:
i have "A" class in which i define two methods add()and substract().
I have another class "B" in which i declared another two methods multiply()and divide().
Now i have a class "C",in which i want to use all the four methods.
Whether it is possible or not.
In
java you can not inherit more than one class.
To achieve multiple inheritance,
you should use interfaces(in which you can declare methods(definition is not allowed))
class A is fine. Change your class B to interface B, syntax:-
interface B { ....}
and then use following code:-
class C extends A implements B
{
...
...
}
[ May 20, 2008: Message edited by: Nisha Puri ]