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 is boolean law?

992


Why is string builder not thread safe?

1013


How to use Media tracker Class.

1081


what is object-oriented programming in java?

997


How to print an arraylist in java?

999


What is parsing and its types?

1024


What does replaceall do in java?

869


What is member in java?

938


Define an abstract class with reference to java.

944


How many digits is int32?

929


What is the history of java?

939


What is ctrl m character?

989


What does opcode mean?

1000


What is Recursion Function?

1128


Explain the importance of import keyword in java?

940