When you think about it, you know that this call here in your last program
sometimes showed a question and sometimes a choice question. But actually, in
other programs, this call could even show something else. We could have a third
class that's also a subclass of questions. Pass it to present question. And
then its display method would be called.
Cuando se piensa en ello, sabes que esta llamada aquí en tu último programa
a veces mostró una pregunta y en otras ocasiones una pregunta de opción. Pero en realidad, en
otros programas, esta llamada incluso podría mostrar algo más. Podríamos tener una tercera
clase que también es una subclase de Pregunta. Pasarla a presentQuestion y
entonces sería llamado su método display.
Quand vous y pensez, vous savez que
cet appel, dans votre dernier programme,
présentait parfois une question
et parfois une question de choix.
Mais en réalité, dans d'autres programmes,
cet appel pourrait même
montrer autre chose.
Nous pourrions avoir une troisième classe
qui est aussi une sous-classe
de questions.
Passez-le à presentQuestion
et puis sa méthode Display serait appelée.
先ほどのプログラムの呼び出しでは
時にはQuestion型が
時にはChoiceQuestion型が表示されましたが
この呼び出しを別のプログラムで使うと
別の物を表示することもできます
3つ目のQuestionクラスのサブクラスを作り
presentQuestionメソッドに渡すと
そのdisplayメソッドが呼び出されます
여러분이 생각을 할 때, 마지막에 있던 프로그램에 있는 이 호출은
가끔은 보통 질문을 내거나 가끔은 선택형 질문을 냅니다. 하지만 사실은,
다른 프로그램에서는, 이 호출은 다른 것을 보여줄 수도 있습니다. 우리는
세 번째 서브 클래스의 질문들을 호출할 수도 있습니다. presentQuestion에
보내면, 그 클래스의 display 메소드가 호출 됩니다.
Khi bạn nghĩ về nó, bạn biết là lệnh gọi ở đây trong trương trình cũ,
thỉnh thoảng hiện một câu hỏi, thỉnh t hoảng hiện câu hỏi lựa chọn, nhưng thực tế,
trong các chương trình khác, lệnh này có thể hiện những thứ khác. Ta có thể có một class thứ ba,
nó cũng là một subclass của question. Truyền nó vào presentQuestion.
Và sau đó, display method của nó sẽ được gọi.