what diff bw constructor method & method

Answers were Sorted based on User's Feedback



what diff bw constructor method & method..

Answer / boopathy

method only accessed after create class object,
but constructor method access when object initialized

Is This Answer Correct ?    10 Yes 0 No

what diff bw constructor method & method..

Answer / prasad

A CONSTRUCTOR METHOD IS A METHOD USED TO PERFORM CUSTOM
INITIALIZATIONS.
AND A NORAMAL METHOD IS HAVING INSTANCE VARIABLES AND METHODS

Is This Answer Correct ?    4 Yes 2 No

what diff bw constructor method & method..

Answer / 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

what diff bw constructor method & method..

Answer / jasbir singh

a constructor method's name is same as the name of class,
secondly, you cannot manually call the constructor method
after creating the object.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Java Related AllOther Interview Questions

What is the use of lambda functions?

0 Answers  


Is java Class Thread safe ???? How to make java Class Thread safe ??

1 Answers   Cognizant, TCS,


How to reverse the singly linked list(In Node data members are(int data,int pointerTONext))

0 Answers  


What is crud operations in java?

0 Answers  


What is lambda expression in mvc?

0 Answers  


In java thread programming, which method is a must implementation for all threads?

0 Answers  


When do we go for java 8 stream api? Why do we need to use java 8 stream api in our projects?

0 Answers  


How to load a class programmatically?

1 Answers  


Which is better openjdk or oracle jdk?

0 Answers  


What is gui in java with examples?

0 Answers  


What is lambda used for?

0 Answers  


what are the different phases in delivering the project during development and maintenance?

0 Answers   CTS,


Categories