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?



what is default constructor and parameterised constructor with example?..

Answer / 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

More Core Java Interview Questions

How to solve the problem of generating the unique hash keys with hash function?

0 Answers  


Why does java have different data types for integers and floating-point values?

0 Answers  


How to sort an array from smallest to largest java?

0 Answers  


how we can write the string concatenation program in java.

3 Answers  


How to check if a list is sorted in java?

0 Answers  


In how many ways we can do exception handling in java?

0 Answers  


Can we override static methods?

18 Answers   Bally Technologies,


Write a function to find out longest palindrome in a given string?

0 Answers  


class A{ some variables; public void a()throws Excepion1,Exception2{....} } class B extends A{ variables... public void a()throws E2,E3{.....} } Qns: here override of methods occurs or not,ore else wil give any compilation error or run properly..plz tell me briefly whts happening with the above codes....

4 Answers   Quinnox,


What should I import for arraylist in java?

0 Answers  


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

0 Answers  


is it possible to instantiate the math class?

0 Answers  


Categories