Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

why the constructor should be used in class,if there is no
constructor what will happen?

Answer Posted / bindhu

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does a for loop work?

942


Is 0 an irrational number?

997


What happens when a thrown exception is not handled?

1050


How dead lock situation occurs in java and how you can identify it?

941


Can we call virtual funciton in a constructor ?

2135


What are autoboxing and unboxing? When does it occur?

891


What are the 4 types of research methods?

873


What is java object name?

940


What is runtime polymorphism or dynamic method dispatch?

970


What is __ init __ functions?

1037


What is array class in java?

1007


Write a program to print 15 random numbers using foreach of java 8?

889


What is the indent key?

989


What is difference between module and function?

1083


Can we inherit a class with private constructor?

1058