inheritanceQuestions

inheritanceQuestions - 2009 November 23 Example Te st...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
2009 November 23 Example Test Questions for Inheritance 1. Give and explain the type rule with genericity using an example method call. 2. Describe constraint genericity. How is such genericity related to inheritance? Provide an example where constraint genericity is useful. 3. When you redefine a feature, you can redefine the signature and body independently. Explain why you need redefinition of each part and what are the constraints on redefinition. 4. When you redefine a feature, there are two parts of a feature you can redefine independently. Explain what they are, why you need redefinition of each part and what are the constraints on redefinition? 5. What is the rule of change in the context of deciding between use and inheritance? Give three natural language definitions and their corresponding Eiffel class definitions that illustrate the choices in deciding between use and inheritance? 6. When using multiple inheritance sharing and replication of attributes are the choices that are available. Using a BON diagram, give an example where sharing is not an option. Explain why sharing is not an option. 7. When using multiple inheritance sharing and replication of attributes are the choices that are available. Using a BON diagram, give an example where sharing and replication are options. Explain why sharing is an option and how you get sharing. Explain why replication is an option and how you get replication. 8. When using multiple inheritance some features may be joined. Using a BON diagram, give an example where join is an option and explain under what conditions join is possible. 9. Explain what happens to the export status of inherited features in an heir. 10. Why would you not normally build the QUEUE class from the ARRAY class using inheritance? 11. In Eiffel, inherited functions can be redefined as attributes but not vice versa. Why not? 12. Consider the following inheritance diagram. What problems can arise and how can they resolved? You are not required to solve all problems simultaneously, just describe the various problems and their resolution.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sample Inheritance Test Questions Page 2 of 9 f g B ++ f g C f, h, j A D 13. Consider the following BON diagram. PERSON work : T + TA STUDENT work ++ : T TEACHER A Give and explain one variation of the Eiffel inheritance and adaptation clauses for the class TA that permit sharing the common feature. B Give and explain a different variation of the Eiffel inheritance and adaptation clauses for the class TA that permit sharing the common feature. C Give and explain the Eiffel inheritance and adaptation clauses for the class TA that permit replicating the common feature D Using an example, explain static and dynamic types of an entity and how they relate. 14.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/11/2010 for the course CSE CSE 3311 taught by Professor A during the Winter '10 term at York University.

Page1 / 9

inheritanceQuestions - 2009 November 23 Example Te st...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online