1. Computer Science Large Practical:
Quick quiz on Objective-C
Stephen Gilmore
School of Informatics
Friday 19th October, 2012
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 1 / 15
2. Question: Does this program print Yes, No or neither?
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 2 / 15
3. Answer: it prints Yes.
. . . it prints Yes.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 3 / 15
4. Question: Does this program print Yes, No or neither?
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 4 / 15
5. Answer: it prints No.
. . . it prints No.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 5 / 15
6. Question: Does this program print Yes, No or neither?
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 6 / 15
7. Answer: neither, it throws an exception.
. . . neither, it throws an exception.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 7 / 15
8. Question: Does this program print Yes, No or neither?
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 8 / 15
9. Answer: it prints No.
. . . it prints No.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 9 / 15
10. Question: Does this program print Yes, No or neither?
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 10 / 15
11. Answer: it prints No, because we are using pointer equality
. . . it prints No, because we are using pointer equality
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 11 / 15
12. Question: Does this program print Yes, No or neither?
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 12 / 15
13. Answer: it prints Yes, because we are using content
equality
. . . it prints Yes, because we are using content equality
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 13 / 15
14. Question: Does this program print Yes, No or neither?
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 14 / 15
15. Answer: neither, it throws an exception because we forgot
to call init
. . . neither, it throws an exception because we forgot to call init
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 15 / 15