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

v-model life cycle

2089


Can we return null in java?

1217


Where is singleton pattern used?

1038


Write java program to reverse string without using api?

1104


describe method overloading

1076


How to avoid memory leak in java?

1178


What is a Transient Object?

1128


What is an example of a constant variable?

1145


What is the synonym of string?

1134


Can a main method be overloaded?

1067


Why are pointers not secure?

1072


Define a package.

1168


What is the relationship difference the canvas class and the graphics class?

1110


Can a method be static?

1017


What is purpose of keyword void?

1090