what are the types of constructer explain with example

Answer Posted / kailash

there are two types of Constructors .
1. Parameterized Constructor inwhich we give arguments .
2. Default constructor , there no argument is given .
for each class there must be a defult constructor .

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stateless object in java?

579


What is lambda expressions action func and predicate?

520


Spring framework ---Can somebody explain me in easily understandable format about AOP, IOC and DI, so that i can explain in interview rather than just telling what is available in net. I am not able to understand that also. I am new to Spring

1664


What is proxy object in java?

647


What is the difference between collection and stream?

551






In a barber shop there are 2 doors. customer come in 1 door, leave in other. minimum # of chairs. barber spend his life in cutting. always barber can cut 1 customer. few chairs in the shop. if barber busy customer waits, if chairs full, customer leave. if no customer, barber sleeps. treat barber and customer as 2 threads. you can use Semaphore class with arrive and depart and count as parameter.

1771


How do I open the java console in windows 10?

622


What is rxjava2?

536


What is a jvm?

617


What is @resource annotation in java?

569


Why are command line arguments passed as a string?

571


How do I open the java control panel?

582


What is java flatmap?

549


Explain main thread under thread class execution?

550


What is explicit casting?

622