3-SUMMER 2017 Page 4 Code a simple class program called OnceUponATime. This program is Hainy Tales. In the OnceUponATime program code a no-args/empty cotrt e main characiat. overloaded constructor that accepts the story for a fairy tale and the th main characters , then, code an The overloaded constructor will print the name for the story along name as part of the message below. In the main) of an application lass and send to t and send to it TestOnceUponATime, instantiate an object of the OnceUponATime class Sleeping Beauty” and “Princess Aurora” (10 points) Message to be printed in the overloaded constructor: e fairy tale is Xxxxxxxoxxx and its leading character is Xxxxxxxoxxx
Expert Answer
package fairyTales;
public class OnceUponATime {
public OnceUponATime() {
}
public OnceUponATime(String story, String mainCharacter) {
System.out.println(“The fairy tale is ” + story
+ “and its leading character is ” + mainCharacter);
}
// TestOnceUponATime class through main method
public static void main(String[] args) {
OnceUponATime oUATime = new OnceUponATime(“Sleeping Beauty”,
“Princess Aurora”);
}
}
Description:
——————
You need to execute the main method which will instrantiate OnceUponATime class object and invoke implicitly parameterized constructor and display the story name and main leading character.