What is constructor

Answers were Sorted based on User's Feedback



What is constructor..

Answer / nagendra kumar

1.A Constructor is Just like a method without return type.
2.The Class name and the Constructor name should be same.
3.Constructor are useful to initialize instance variable
with their default values.
4.Constructor can be executed only once while creating the
Object.

Is This Answer Correct ?    43 Yes 2 No

What is constructor..

Answer / jaseer v

Special function that is used to initialise the objects
Name same as class
.............

Is This Answer Correct ?    13 Yes 6 No

What is constructor..

Answer / giridhar gangapatnam

Constructor is the method which has the same name of class
and constructors are executed only once at the time of
object creation

Is This Answer Correct ?    7 Yes 0 No

What is constructor..

Answer / sameer inamdar

Constructor is a method like other methods but it has
the same as the class name and it has no any return type
not even void.
Connstructor is invoke only once at the time of object
creation. We can overload the constructor.

Is This Answer Correct ?    7 Yes 1 No

What is constructor..

Answer / mah

constructor is similar to a function.constructor name and
class name should be same.constructor donot return any value

Is This Answer Correct ?    4 Yes 0 No

What is constructor..

Answer / guest

constructor is special method with the class name and
without any return value.

whenever the object is created the constructor is called
automatically according to the argument passed.

Is This Answer Correct ?    1 Yes 0 No

What is constructor..

Answer / mahesh

constructor is similar to a method.
*constructor name ,class name should be same
*constructor have a parameters
*does not return any value

*

Is This Answer Correct ?    1 Yes 0 No

What is constructor..

Answer / diya

constructor is a special function whose task is to
initialise the object.the name of the constructor is as
same as the class.

Is This Answer Correct ?    1 Yes 0 No

What is constructor..

Answer / venu

Constructor is a member function of a class..Which gets called whenever you create an object of that class

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is main purpose of abstract class?

7 Answers  


Can an interface extands a class?

5 Answers  


Is a boolean 1 bit?

0 Answers  


Explain about the main() method in java?

0 Answers  


Define linked list and its features with signature?

0 Answers  






What does a za z0 9 mean?

0 Answers  


There are 2 classes, 1 LandAnimal and another WaterAnimal. There is another class Animal which wants to have the properties of both LandAnimal and WaterAnimal. How will you design this situation?

6 Answers   KPIT,


What is a Java Virtual Machine?

1 Answers  


what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread

0 Answers  


we cannot create an object of interface but we can create a variable of it

1 Answers  


What does next mean in java?

0 Answers  


What is a singleton class in Java?

0 Answers  


Categories