answersLogoWhite

0


Best Answer

It is the way to create the instances of class. in java. to know how constructor works first you should be clear with the concept of class.

User Avatar

Wiki User

โˆ™ 2013-02-04 07:24:50
This answer is:
User Avatar
Study guides

Mixture

1 card

Class

โžก๏ธ
See all cards
4.36
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
22 Reviews

Add your answer:

Earn +20 pts
Q: What is meant by constructor in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does Java support copy constructor?

No. Java does not support copy constructor


When does the compiler supply a default constructor for a class in java?

When the programmer has not coded a constructor for any java class.


What happens when no constructor function is declared in a class - in Java?

When any constructor is deffined in your class, the java compiler create a default no argument constructor for you. This constructor only have an invocation to the super class constructor (" super( ) ").


How many types constructors are there in java?

Default Constructor Parameterised Constructor Non Parameterised Constructor


What is use of constructor in java?

Constructor is used to do something (written in constructor) immediately after object creation.


Is there a sample program for constructor?

All Java programs would have a constructor... public class Test { public Test(){ ... } ..... } This is a constructor. Even if you dont code the constructor Java would automatically place a default constructor for compilation.


Is there any alternative to constructor in Java?

No. The constructor is the starting point of creation of any object in Java. Without going through a constructor you cannot create an object


Why constructor in java?

What are the importance of constructor in java? Constructor is automatically called immediately after the object is created , before the new operator complete . Constructor is important because they have no return type , not even void.


Is it mandatory to use constructor in a class?

In the case of Java, not always. The class does require a constructor, but the compiler will automatically include an "empty constructor" (constructor without parameters) under certain conditions.In the case of Java, not always. The class does require a constructor, but the compiler will automatically include an "empty constructor" (constructor without parameters) under certain conditions.In the case of Java, not always. The class does require a constructor, but the compiler will automatically include an "empty constructor" (constructor without parameters) under certain conditions.In the case of Java, not always. The class does require a constructor, but the compiler will automatically include an "empty constructor" (constructor without parameters) under certain conditions.


Can a constructor be defined within a method in java?

No.


How you create a java constructor?

When we want to create an Object for a class at that time we will write constructor.


Can you initialize an object without constructor in java?

No. if you wish to create an object that you plan on using in a java program then the answer is NO. You cannot initialize an object of a Java class without calling the constructor.

People also asked