what diff bw constructor method & method
Answers were Sorted based on User's Feedback
Answer / boopathy
method only accessed after create class object,
but constructor method access when object initialized
| Is This Answer Correct ? | 10 Yes | 0 No |
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 |
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 |
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 |
Why is struts used in java?
What is javacpl?
What is flatmap in java8?
What are java’s rules regarding tabs, spaces and newline characters?
I am trying to create a new universal user group. Why can't i? : java security
How do I install jdk?
What is dependency injection in java?
What is the difference between collection and stream?
Can I have multiple main methods in the same class?
Which is faster c++ or java?
program A and B are analysed and found to have worst case running time greater than 150NlogN and N*N respectively. which program has the better guarantee after the running time for the large values of N(N>10000)? which program has the better guarantee for the running time of small program N (N<100)? which program will run faster on average for N=1000?
0 Answers St. Pauls University,
What is ioexception in java?