what diff bw constructor method & method

Answer Posted / sowjanya

constructor is special method with the basic initialization
information of the class variables.this constructor is
accessed at the time of object creation .from this object is
created with initial assignment values of variables. and we
can't call constructor separately.
if you have more than one constructor default constructor is
invoked at the object creation time and we can call other
constructor as we need .
constructor name is same as class name this is way to
identify methods is constructor.
methods are not invoked not default we call that as we
need.method name is not a class name.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between the boolean & operator and the && operator?

513


can anyone tell me what kind of questions are asked for core java exam in aptech

1444


differences between iterator and spliterator in java se 8?

544


Explain working of java virtual machine (jvm)?

500


Are there tuples in java?

473






Can the main method be overloaded?

554


What do you understand by downcasting?

503


Are jvm’s platform independent?

483


explain isalive() method under thread class?

577


What is custom tag in java?

515


Why is class forname used in java?

485


How do I enable java in google chrome?

436


What is java persistence api used for?

437


What about products that claim to block java applets at a firewall? : java security

477


What if I do not provide the string array as the argument to the method?

494