20091012-Null&Puzzle

20091012-Null&Puzzle - CSE115: Introduction to...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Announcements I did not lecture from slides. • I showed a demo of ‘green’ for UML class diagrams. I showed a demo of the lab 4 solution. • We talked about ‘null’, the null reference. We ended with a puzzle.
Background image of page 2
Attendance I checked attendance today: 72% of registered students attended 28% of registered students did not attend Lecture and lab attendance is closely linked with success in the course: students who do NOT attend regularly tend to fail students who do attend regularly tend to pass (with good grades)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
‘null’ • ‘null’ denotes the null reference, a reference which does not refer to any object. • We can use ‘null’ to solve the two dogs, one collar problem (see code on next slide):
Background image of page 4
removeCollar rather than getCollar public class Dog { private Collar _collar; public Dog(Collar collar) { _collar = collar; } public void setCollar(Collar collar) { _collar = collar; } public Collar removeCollar() { Collar temp = _collar; _collar = null; return temp; }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

20091012-Null&Puzzle - CSE115: Introduction to...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online