What is a constructor ?

A constructor is a special member function which will construct an object with user defined values whenever object is created OR A constructor is a special member function which will be called automatically to initialize the data member of a class whenever object is instantiated.

Showing Answers 1 - 18 of 18 Answers

siva kumar reddy

  • Aug 7th, 2006
 

 hi

constructor is special method in java.constructor does not returns anything even void also.constructor is used to intilise the objects with same data or different data.default constructor is available in its sub class but parameterised constructor is not available in its subclass thats why we used super keyword .

siva

  Was this answer useful?  Yes

suresh

  • Aug 16th, 2006
 

Constuctor is a method having same name as class which intialises the fields when the object is instantiated.

  Was this answer useful?  Yes

MoorNattu_MCA

  • Aug 21st, 2006
 

constructor is a member function. it 's initializing the objects during the runtime. the class name and must be the same,then it has no return type,whenever the object is created the constructor automatically executed.

  Was this answer useful?  Yes

gowrish_1894

  • Oct 19th, 2006
 

Constructor hasa the same name of that class.it is a special method that is invoked automaticaly when you create on object of class.

  Was this answer useful?  Yes

nadhamunireddy

  • Dec 12th, 2006
 

A thread represent a process. JVM executes statements one by one it is called process. JVM will creates one thread internally.

  Was this answer useful?  Yes

1)   Constructor is one of the member function of the class.

constructor is used to intialize any variable or data when a class will invoke.

2) Threads are sometimes called lightweight processes.

it provides an execution environment.

similar to process only difference is to create a thread we require only very less resources when compared to process.

Thread is very very simple task

  Was this answer useful?  Yes

Sukhpal singh

  • Jan 29th, 2007
 

HI The main purpose of constructor to initialize the fields of class . It call automatically ,when object of that class is created

  Was this answer useful?  Yes

apparao.mca

  • Sep 29th, 2008
 

A java constructor has the same name as the name of the class to which it belongs. Constructor's syntax does not include a return type, since constructors never return a value.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions