How to prevent to create multiple objects of a java class?

Answer Posted / naseer

declare constructor as private .that class only create one object

Is This Answer Correct ?    10 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain reverse a linked list recursive java solution?

519


What is t type java?

620


How to create a base64 decoder in java8?

552


Explain wait(), notify() and notifyall() methods of object class ?

585


Can we sort hashmap in java?

524






How to handle a web browser resize operation?

536


What are three advantages of using functions?

531


Difference between throw and throws?

614


What is api in java?

530


What is public/private protected in java?

539


What is a variable in java?

524


I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com

1066


What are the restrictions imposed by a Security Manager on Applets?.

2059


What do you understand by java virtual machine?

700


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

827