CSC 216 F09/inheritance1: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
[http://meta.wikimedia.org/wiki/Help:Wikitext_examples Formatting Help Guide from MetaWiki]
[http://meta.wikimedia.org/wiki/Help:Wikitext_examples Formatting Help Guide from MetaWiki]


==Place Title of Exercise Here==
Inspired by: [http://www.thiagi.com/pfp/IE4H/march2004.html#StructuredSharing thiagi Training Games: 4 C's]


Give the title of your exercise, which may include the name of the topic you are covering, or some other catchy title.
=Inheritance PassDown=


===The problem===
===The problem===


Describe what you are attempting to teach students by this exercise.
A review of how Java's feature of inheritance is properly implemented and review the basic features of said property.


===Participants and props===
===Participants and props===


How many students will participate? What else do you need (e.g., old tennis ball, Powerpoint slides, software).
All students will participate, divided into three teams. One member of each group will need pencil and paper to write down their group's answers.


===The script===
===The script===


Describe how to do your exercise.
All three groups will answer the same three questions.  After all the questions have been asked, groups will reconvene and compare their answers.  The group that gets the most correct answers will receive a prize at the end of the game (ranging from candy to extra credit, depending on how benevolent the teacher feels).
 
====First Question====
The first question is: "What are the components of inheritance?"
 
====Second Question====
The second question is: "What are the characteristics associated with inheritance?"
 
====Third Question====
The third question is: "What are the challenges associated with inheritance?"
 
====Answers====
 
=====Question One=====
The superclass, the subclass, the 'extends' Java keyword
 
=====Question Two=====
Defines a 'is-a' relationship, used to define a more specific relationship between objects (A checking account is a bank account)
 
=====Question Three=====
The ability to apply and make use of inheritance correctly (i.e. With a superclass Animal and subclass Cat: Animal cat = new Animal();. Cat would only have access to the Animal class - it would not be able to call any of the methods in Cat; Animal cat = new Cat(); would be able to, however). Understanding the concept behind inheritance and identifying which situations you would use it in is key to being able to utilize inheritance effectively.  Also, the ability to differentiate between 'is-a' relationships (inheritance) and 'has-a' relationships (interfaces).
 
 
=Created by: Chris Coffey and Patrick Devore=

Latest revision as of 21:30, 13 November 2009

Formatting Resources

Formatting Help Guide from MetaWiki

Inspired by: thiagi Training Games: 4 C's

Inheritance PassDown

The problem

A review of how Java's feature of inheritance is properly implemented and review the basic features of said property.

Participants and props

All students will participate, divided into three teams. One member of each group will need pencil and paper to write down their group's answers.

The script

All three groups will answer the same three questions. After all the questions have been asked, groups will reconvene and compare their answers. The group that gets the most correct answers will receive a prize at the end of the game (ranging from candy to extra credit, depending on how benevolent the teacher feels).

First Question

The first question is: "What are the components of inheritance?"

Second Question

The second question is: "What are the characteristics associated with inheritance?"

Third Question

The third question is: "What are the challenges associated with inheritance?"

Answers

Question One

The superclass, the subclass, the 'extends' Java keyword

Question Two

Defines a 'is-a' relationship, used to define a more specific relationship between objects (A checking account is a bank account)

Question Three

The ability to apply and make use of inheritance correctly (i.e. With a superclass Animal and subclass Cat: Animal cat = new Animal();. Cat would only have access to the Animal class - it would not be able to call any of the methods in Cat; Animal cat = new Cat(); would be able to, however). Understanding the concept behind inheritance and identifying which situations you would use it in is key to being able to utilize inheritance effectively. Also, the ability to differentiate between 'is-a' relationships (inheritance) and 'has-a' relationships (interfaces).


Created by: Chris Coffey and Patrick Devore