Please help!

I have to complete the main method to construct at least 2 Riddle objects and call their printQuestion() and printAnswer() methods to ask and answer the riddle in this class:

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

    }
}

So, what is stopping you?

1 Like