question archive Complete the Riddle class below and complete the main method to construct 2 Riddle objects and call their printQuestion() and printAnswer() methods
Subject:ManagementPrice: Bought3
Complete the Riddle class below and complete the main method to construct 2 Riddle objects and call their printQuestion() and printAnswer() methods.
public class Riddle
{
// write 2 instance variables for Riddle's question and answer: private type variableName;
// constructor
public Riddle(String initQuestion, String initAnswer)
{
// set the instance variables to the init parameter variables
}
// Print riddle question
public void printQuestion()
{
// print out the riddle question with System.out.println
}
// Print riddle answer
public void printAnswer()
{
// print out the riddle answer with System.out.println
}
// main method for testing
public static void main(String[] args)
{
// call the constructor to create 2 new Riddle objects
// call their printQuestion() and printAnswer methods
}