Author Topic:   Can anybody help me?
SaiRam NageshKumar
greenhorn
posted April 20, 2000 05:59 AM             
1. How we can call a constructor of an abstract class (also from its inherited class)?
2. How can we get a value of a method of a class(any type) in return using NO return statement in that particular method?

Please help in this regard!
Thanks,
Sai Ram.

Gary Smith
greenhorn
posted April 20, 2000 07:08 AM             
1. You can call a parent constructor by calling super(any arguments) as the first line in your constructors. Note, however, that you cannot do things like super.super() as this implies knowledge of the implementation which is not OO.

2. Could you explain what you mean here ?

SaiRam NageshKumar
greenhorn
posted April 20, 2000 09:23 PM             
Suppose a method myMethod() is there its return type is not void but any thing else. But the restriction is it has no return statement at all.
code:

class myClass {

int myMethod() {
// code here


}
public static void main(String args[]) {
//some code here

int xxx = myMethod(); //something like this!
}
}


now I want this method is called from another method or class or from a main() block.

I hope this time its clear!
Your answer to the first q is not been cleared. Please let me know in detail.

regds,
Sai Ram.

[This message has been edited by SaiRam NageshKumar (edited April 20, 2000).]

[This message has been edited by SaiRam NageshKumar (edited April 20, 2000).]

[This message has been edited by SaiRam NageshKumar (edited April 20, 2000).]

maha anna
bartender
posted April 23, 2000 07:24 PM             
SaiRam NageshKumar,
Your code will not compile at all. Because a method which returns something other than void has to return some return value which is compatible with the declared return type of the method.

I am not sure what you want actually. May be I didn't get you exactly.
regds
maha anna

|