Question: Java 2. Create a class called Merlin that has only one attribute, the Wisard, which is static and of type Merlin . Merlin - a

Java
 Java 2. Create a class called Merlin that has only one

2. Create a class called Merlin that has only one attribute, the Wisard, which is static and of type Merlin . Merlin - a private constructor. Only this class can invoke this constractor. No other class or returns the Wizard if it not null, if the Wizard is null, this method The class has one constructor and only two methods program can create an instance of Merlin. o returning it mon- a static method that creates an instance of Merlin using the private constructor and assigns it to the Wizard before a non-static method that returns tbe string Pull the sword from the stoe (a) Write the class here.(5 points) Answer: Your class code. (Max 10 lines of code) what you understood about this class. Please, do not write more than three or four sentences. (5 points) Answer: Your code (Just create two wizards and test the methods. Print toString) of each wizard but, don't write a toString) method.) (b) Write a Test class to test the class Merlin. It is going to be even shorter. After the code, write

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!