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

explain isalive() method under thread class?

581


What is meant by annotation in java?

485


What is the use of flatmap in java 8?

461


What is jdk jre and jvm?

512


What is connection pooling in java?

519






Which interceptor is responsible for setting action javabean properties?

436


Differences between intermediate operations and terminal operations of java 8’s stream api?

485


Why java is better than node.js?

476


Why dependency injection is used in java?

477


there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reseve only 5 seat at a time. If person reserving seat , the care is atken that he may get all in row. if seats are not available in row then the arrangement is so that person group get nearby seats. the following class is given public class seat { char name; int seat; boolean isSeatempty } 1.Draw require class digram and object diagram. 2.Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name.

2646


What is flatmap java?

496


What is the difference between collection and stream?

476


What is tier in java?

419


What is mdb in java?

511


Who created eclipse?

479