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


Please Help Members By Posting Answers For Below Questions

What is a java applet? What is an interface?

635


If I only change the return type, does the method become overloaded?

541


is it possible to instantiate the math class?

535


Can we pass a primitive type by reference in java? How

534


Can you explain the final method modifier?

571






What are local variables?

599


Can a vector contain heterogenous objects?

607


What does sprintf return?

592


What are the differences between checked exception and unchecked exception?

531


What is the difference between Error, defect,fault, failure and mistake?

666


What is the purpose of the finalize() method?

717


What do you mean by mnemonics?

537


What is data and its types?

576


Why do we use regex?

563


What is the output of the below java program?

599