Question: Please download Test.java file from Blackboard under LAB 1 folder. Your task is to modify the Singleton class inside the Test.java file, so that it
Please download Test.java file from Blackboard under LAB folder.
Your task is to modify the Singleton class inside the Test.java file, so that it allows creation of only one
instance of Singleton.
Write a main to test your program.
Add a subclass to your hierarchy with the name SubSingleton. Instead of Singleton class, use SubSingleton
to test your main. Modify your code if needed.
Lastly, change the number of SubSingleton instances that can be created. Singleton class allows the creation
of just one instance. SubSingleton should allow three. Use the following guidelines
Test class:
package lab;
class Singleton
String name;
public SingletonString name
this.name name;
public String toString
return name;
public class TEST
public static void mainString args
System.out.printlnnew SingletonI;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
