quick quiz on objective-c
DESCRIPTION
A quick quiz to point out some of the differences between Objective-C and Java.TRANSCRIPT
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
Question: Does this program print Yes, No or neither?
shot 2012-10-19 at 09.47.10.png
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 2 / 15
Answer: it prints Yes.
shot 2012-10-19 at 09.47.10.png
. . . it prints Yes.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 3 / 15
Question: Does this program print Yes, No or neither?
shot 2012-10-19 at 09.48.50.png
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 4 / 15
Answer: it prints No.
shot 2012-10-19 at 09.48.50.png
. . . it prints No.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 5 / 15
Question: Does this program print Yes, No or neither?
shot 2012-10-19 at 09.49.52.png
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 6 / 15
Answer: neither, it throws an exception.
shot 2012-10-19 at 09.49.52.png
. . . neither, it throws an exception.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 7 / 15
Question: Does this program print Yes, No or neither?
shot 2012-10-19 at 09.50.17.png
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 8 / 15
Answer: it prints No.
shot 2012-10-19 at 09.50.17.png
. . . it prints No.
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 9 / 15
Question: Does this program print Yes, No or neither?
shot 2012-10-19 at 10.23.38.png
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 10 / 15
Answer: it prints No, because we are using pointer equality
shot 2012-10-19 at 10.23.38.png
. . . it prints No, because we are using pointer equality
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 11 / 15
Question: Does this program print Yes, No or neither?
shot 2012-10-19 at 10.24.29.png
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 12 / 15
Answer: it prints Yes, because we are using contentequality
shot 2012-10-19 at 10.24.29.png
. . . it prints Yes, because we are using content equality
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 13 / 15
Question: Does this program print Yes, No or neither?
shot 2012-10-19 at 10.41.28.png
Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 14 / 15
Answer: neither, it throws an exception because we forgotto call init
shot 2012-10-19 at 10.41.28.png
. . . 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