1 / 19

CSE115: Introduction to Computer Science I

CSE115: Introduction to Computer Science I. Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu. Phones off Signs out. 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

glen
Download Presentation

CSE115: Introduction to Computer Science I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Phones off Signs out

  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() { } }

More Related