COSC 2P91
Objects with class Week 8b
Brock University
Brock University (Week 8b) Objects with class 1 / 14
COSC 2P91 Objects with class Week 8b Brock University Brock - - PowerPoint PPT Presentation
COSC 2P91 Objects with class Week 8b Brock University Brock University (Week 8b) Objects with class 1 / 14 Before we begin Wanna see a neat trick? Remember the conundrum of how to swap the contents of two variables without using a third
Brock University (Week 8b) Objects with class 1 / 14
Brock University (Week 8b) Objects with class 2 / 14
Brock University (Week 8b) Objects with class 3 / 14
◮ Just use our old friend, the short-circuit and ◮ x and x.dealie
◮ Bird.tweet(b) Brock University (Week 8b) Objects with class 4 / 14
Brock University (Week 8b) Objects with class 5 / 14
Brock University (Week 8b) Objects with class 6 / 14
Brock University (Week 8b) Objects with class 7 / 14
Brock University (Week 8b) Objects with class 8 / 14
◮ Assign a class variable, invoking property with the getter and setter
◮ Precede the getter and setter with the @property tag
Brock University (Week 8b) Objects with class 9 / 14
Brock University (Week 8b) Objects with class 10 / 14
Brock University (Week 8b) Objects with class 11 / 14
◮ It explains what to do when the folder is imported ◮ You’ll need to define what ’*’ (all) is, though Brock University (Week 8b) Objects with class 12 / 14
Brock University (Week 8b) Objects with class 13 / 14
Brock University (Week 8b) Objects with class 14 / 14