+ 1
can anybody tell me the complete description of this program?
public static void add(number a,number b) { number c= a.add(b); c.display(); }
6 Answers
+ 2
How do you know it's intended to be the same method? I think they are different methods. number is a class or struct with a badly designed name (start with uppercase for clearancy) and has method add which accepts another object instance of the same type, does some hidden magic inside of it and returns a result which is also of type "number". It seems that this class/struct has a display method as well which probably outputs something from it.
0
what does number indicate here .. please specify that
0
it is recursion as you are calling add func in add fucn ....With no termination Condition (base condition) ..if add method is in Number class ...so that It become infinte calling of function...
0
actually i m trying to make interface .so this will act as a refrencing party
0
can we create a struct in java??
0
most probably you are using overloading in this case.. if you want the working submit the code for add method that takes a number argument and outputs a number object type..considering number is a class name ...it's better if you obey java rules while defining classes