Days before, I created Question, Quiz, and Main classes. One Quiz has one or more Questions. From the main class I first create Question objects (the constructor accepts an array of numbers). The Quiz is like when I display the questions I omit the last number of the array and the user will try to figure out that number. Then from Main I created a Quiz Object. From Main I only call methods of the Quiz class and from Quiz Class I only call methods in Question class.
Then I also created a web application (with JSP and Servlets) which uses the same Question and Quiz classes but not Main. Instead of Main I used JSP and Servlets to display the data. So without modifying the model classes(Quiz and Question) I am able to use them from other applications.
But now, I need to add a HINT, which will give the user hints for every questions. If I go and modify those 2 model classes, I am going to violate the Open-Close principle. If I am going to create a class called Hint(one hint per question) and extend from question class, it doesn't make a sense because Hint is not a Question. But Question has a hint.
Can you please guide how to have a HINT in my application so that I will use the previous classes without modification and violating any OOP concepts?