why the constructor should be used in class,if there is no
constructor what will happen?
Answers were Sorted based on User's Feedback
In Java, initialization of every object possible
by providing a constructor. If a class has a constructor,
Java automatically calls that constructor when an object is
created. So initialization is guaranteed.
If we don't define a constructor for a class, a default
parameterless constructor is automatically created by the
compiler.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / devarathnam c,kotagudibanda(po
Hi... Nothing will happen the compilet will supply the
default constructor of the class.Normally canostructor can
be used to instantiate an object.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / yamini
Constructor is used initialize certian paramameters to each
object on their creation.We can also overload
constructors.So we can initialize objects with diff params.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ravikiran
constructor is used to initialize the variables during the
creation of instances.
If there is no constuctor no object will be gets created.
| Is This Answer Correct ? | 0 Yes | 3 No |
how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application
how to use crystal reports in java
In the below Java Program, how many objects are eligible for garbage collection?
What is the difference between instanceof and isinstance?
What is the use of static import ?
Can a class have multiple superclasses?
define the terminology association.
What are the six ways to use this keyword?
what is deadlock in threads? with example
as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
why are there separate wait and sleep methods? : Java thread