Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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

Which method cannot be overridden in java?

0 Answers  

What are the advantages of java over C++?

0 Answers  

What is identifier give example?

0 Answers  

When a byte datatype is used?

0 Answers  

How do you replace all in word?

0 Answers  

What classes can be used to store arbitrary number of objects ?

1 Answers  

What is module in project?

0 Answers  

How could Java classes direct program messages to the system console, but error messages, say to a file?

2 Answers  

What do you mean by order of precedence and associativity?

0 Answers  

Can finally block be used without a catch?

0 Answers  

What is scope & storage allocation of static, local and register variables? Explain with an example.

0 Answers   IBS,

what is the use of thread?Justify it by project point of view

7 Answers