Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 1.

Similar presentations


Presentation on theme: "CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 1."— Presentation transcript:

1 CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu 1

2

3 Announcements Advice –take notes in lecture –don’t rely only on slides –REVIEW notes regularly –bring notes to recitation Web-CAT –we’re tweaking it –don’t worry if you get e-mail about regrading

4 Agenda Brief review Unified Modeling Language (UML) Methods in general

5 BRIEF REVIEW

6 Object class instantiation created by ‘new’ + constructor representation stored on heap

7 Reference an address value of ‘new’ expression

8 Variable name location type value scope lifetime local variable instance variable

9 Expression examples of expressions –‘new’ expression –variable expression (on RHS of assignment) example1.Terrarium t1; example1.Terrarium t2; t1 = new example1.Terrarium(); t2 = t1;

10 package organizational mechanism each class belongs to a package

11 class “blueprint” of an object

12 constructor used by new to initialize a new object

13 scope static property of variable part of program text where a variable declaration holds

14 lifetime runtime property of variable period of time during which variable exists in memory

15 UML Unified Modeling Language –industry standard Class diagrams

16 UML Unified Modeling Language –express design without reference to an implementation language For example

17 Binary Class Relationships: directional binary  two classes are involved –source class has code modification –target class does not composition –source: WHOLE –target: PART in diagram: –line decoration is on source/WHOLE –show only detail that’s needed/desired

18 package cse115; public class Dog { public Dog() { } package cse115; public class Tail { public Tail() { }

19 package cse115; public class Dog { private Tail _tail; public Dog() { _tail = new Tail(); } package cse115; public class Tail { public Tail() { }


Download ppt "CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 1."

Similar presentations


Ads by Google