摘要: So far we have seen stack diagrams, which show the state of a program, and object diagrams, which show the attributes of an object and their values. T... 阅读全文
posted @ 2014-10-06 18:48 平静缓和用胸音说爱 阅读(339) 评论(0) 推荐(0) 编辑
摘要: The language feature most often associated with object-oriented programming is inheritance. Inheritance is the ability to define a new class that is a... 阅读全文
posted @ 2014-10-06 18:10 平静缓和用胸音说爱 阅读(414) 评论(0) 推荐(0) 编辑
摘要: To deal cards, we would like a method that removes a card from the deck and returns it. The list method pop provides a convenient way to do that. Sinc... 阅读全文
posted @ 2014-10-06 17:33 平静缓和用胸音说爱 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Now that we have Card objects, the next step is to define a class to represent decks. Since a deck is made up cards, a natural choice is for each Deck... 阅读全文
posted @ 2014-10-06 14:17 平静缓和用胸音说爱 阅读(260) 评论(0) 推荐(0) 编辑
摘要: For built-in types, there are conditional operators (, ==, etc.) that compare values and determine when one is greater than, less than, or equal to an... 阅读全文
posted @ 2014-10-06 13:55 平静缓和用胸音说爱 阅读(179) 评论(0) 推荐(0) 编辑