what is private constructor?what are the uses of writing
private constructor in our program?

Answer Posted / amit

Private constructor can be used to make a pure static
class, using it we can create only one instance of class at
the loading time.

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why are pointers not secure?

532


How do you use spaces in java?

520


What are Normalization Rules? Define Normalization?

546


what is mena by object block any what is the use of that

1766


How can I right-justify a string?

621






What does it mean that a class or member is final?

553


What class of exceptions are generated by the java run-time system?

624


What is the function of http?

527


Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?

542


What are annotations in java?

619


Can you instantiate the math class in Java?

604


Can a final method be overloaded?

504


Can you create an object of an abstract class?

547


What is a super method?

528


What does indexof return in java?

531