Question: 19. Below is a normal Java class called Singleton. Please make changes in its code to make it follow the requirements of the Singleton design

19. Below is a normal Java class called Singleton. Please make changes in its code to make it follow the requirements of the Singleton design pattern so that there will be only one single instance exists when using this class. This question requires your code to be compiled without syntax errors. You can upload a java file for this question. (10 pts.) public class Singleton { private int data member: public Singleton) { data member = 0; } public int getData { return data member: } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
