Differentiate constructor and a method and how are it be
used?
Answer Posted / devarathnam c,kotagudibanda(po
Hi...
Constructor(): It is also a method but it doesnot allow
return type even void also.It will call automatically
whenever an object is created of a appropriate class.
But class name and constructor should be the same.d
Method():U have to call explicitly .
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a java applet? What is an interface?
If I only change the return type, does the method become overloaded?
is it possible to instantiate the math class?
Can we pass a primitive type by reference in java? How
Can you explain the final method modifier?
What are local variables?
Can a vector contain heterogenous objects?
What does sprintf return?
What are the differences between checked exception and unchecked exception?
What is the difference between Error, defect,fault, failure and mistake?
What is the purpose of the finalize() method?
What do you mean by mnemonics?
What is data and its types?
Why do we use regex?
What is the output of the below java program?