20091014-this_Interfaces

20091014-this_Interfaces - Click to edit Master subtitle...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Click to edit Master subtitle style CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739 alphonce@buffalo.edu Announcements Install session tonight: Baldy 21 @ 5:00 PM Exam 2 on Wednesday 10/21 covers material from last exam up to and including Friday 10/16 Review on Monday 10/19 Recall the Dog class 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; } } Consider this code Dog fido = new Dog(new Collar()); Dog rover = new Dog(new Collar()); 1025 825 fido rover 800 825 1000 1025 800 1000 _collar _collar Dog fido = new Dog(new Collar()); Dog rover = new Dog(new Collar()); fido.setCollar( rover.removeCollar() ); public Collar removeCollar() { Collar temp = _collar; _collar = null; return temp; } Consider this code 1025 825 fido rover temp 800 825 1000 1025 800 1000 _collar _collar Dog fido = new Dog(new Collar());...
View Full Document

Page1 / 16

20091014-this_Interfaces - Click to edit Master subtitle...

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

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