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 is runtime polymorphism or dynamic method dispatch?
How to set the permissions to a file in java?
What is java in simple terms?
What does a void function return?
What is a java list?
What is Session reduplication and how its done?
Is 0 a prime number?
Can we declare array without size in java?
Explain the importance of throwable class and its methods?
What is the difference in between cpp and java? Can u explain in detail?
How many bits is a string?
How do generics work in java?
What is the difference between equals() and == in java?
Explain the difference between intermediate and terminal operations in java8?
Can we override private methods?