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...

what is default constructor and parameterised constructor
with example?

Answer Posted / tushar

Default constructor: this constructor is created by the compiler automatically whenever an object is created.User don't have to write default constructor every class has its default constructor
Parameterized constructor: this constructor is exclusively written by the coder to assign the initial value to an instance variable.By creating parameterized constructor you can overwrite the default constructor.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What value is a variable of the string type automatically initialized?

1107


I want to re-reach and use an object once it has been garbage collected. How it's possible?

1014


What is ellipsis in java?

1064


What are some alternatives to inheritance?

1087


How destructors are defined in java?

1174


What are functions in java?

933


Can we modify the throws clause of the superclass method while overriding it in the subclass?

1031


Can we override private method?

1087


Why do we create public static method in java?

1097


How does indexof work?

945


What are basic keywords?

1037


What are access specifiers in java ?

1125


What is type conversion in java?

1031


Tell me about different OOPS concepts.

992


What is final method?

1060