Answer Posted / vishwanath
because it is called implicitly when object is created... so it doesn't have any target to return values....
for ex..
int v=Integer.parseInt(X.readLine());
int n=fact(v);
int fact(int)
{
.....return ans
}
so it return ans to the variable n which is assigned to calling statement..... when compared the constructor don't have any target to return
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the two basic ways in which classes that can be run as threads may be defined?
What does a method signature consist of?
What is nested interface?
What is java full form?
How to make a class or a bean serializable?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
What variables are stored in stack?
How do you clear a list in java?
What are the disadvantages of object oriented programming?
Can we start a thread twice in java?
when you will synchronize a piece of your code? : Java thread
What are the two parts of a conditional statement?
Explain about interrupt() method of thread class ?
What is math exp in java?
Do extraneous variables affect validity?