1 / 30

Colleen Lewis ColleenL@berkeley

Welcome to CS61BL Grab lecture notes when you come in!!! And sit near someone else b/c you’ll need to be able to talk to them during lecture. Colleen Lewis ColleenL@berkeley.edu. Announcements. Reading assignments are important, but they won’t be announced in lecture. Do the reading!!!

maet
Download Presentation

Colleen Lewis ColleenL@berkeley

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. Welcome to CS61BLGrab lecture notes when you come in!!!And sit near someone else b/c you’ll need to be able to talk to them during lecture. Colleen Lewis ColleenL@berkeley.edu

  2. Announcements • Reading assignments are important, but they won’t be announced in lecture. • Do the reading!!! • The course website: • http://inst.eecs.berkeley.edu/~cs61b/su09/ • Sign-up for the google group • If you weren’t in lab yesterday, talk to me after class.

  3. CS Rocks!

  4. We can show you the world Stacking, searching and queuing Tell us, students, now when did You last see such singing staff?

  5. We can open your minds Take you structure by structure Linked lists, arrays, and... oh, sure! Even hash sets on the side.

  6. A whole new world A new fantastic paradigm No one to tell you no Or where to go Or say you're only Scheme-ing.

  7. A whole new world A dazzling place you never knew But when you're one week nine You'll say it's fine This can be done in Oh square of n. (It can be done in big Oh of n!)

  8. Unbelievable code Indescribable coolness For-loops, while-loops, and do-whiles, Through an endless stream of bytes.

  9. A whole new world (Don't you dare close your debugger!) A hundred thousand things to see (Save your folder - it gets better!) There are bipartite graphs Which can be halved Very much like huge binary trees

  10. A whole new world (Every compile a surprise) With amazing methods to pursue (Every getter and setter) We'll chase them anywhere There's time to spare Let us show inheritance to you

  11. A whole new world That's where we'll be A thrilling chase A wondrous place For you and we

  12. I want to make some Person objects Give me a main method!

  13. Creates the file Person.java

  14. I want to make some Person objects Everyone can make these Person objects To make objects I need a class

  15. Start and end the class

  16. Method named main Everyone can call this method And they don’t need a Person first And returns nothing That takes in some arguments

  17. // Good looking // comment! // TODOs are your friend

  18. Instance variables. One per object! You can even have a reference to a Person

  19. Create a reference to a Person Create a Person Set your reference to point to your object

  20. Person myAge myName myParent 50 Susan Boyle

  21. Constructor for a Person Set this’s instance variables Equivalent to the 3 lines before

  22. Draw what memory looks like at this point!

  23. Answer Person myAge myName myParent 50 Susan Boyle main susan patrick Person myAge myName myParent 101 Patrick Boyle

  24. Draw what memory looks like at this point!

  25. mystery this person2 main susan patrick Person myAge myName myParent 50 Susan Boyle Person myAge myName myParent 101 Patrick Boyle

  26. Person myAge myName myParent 1 This is not my parent mystery this person2 main susan patrick Person myAge myName myParent 50 Susan Boyle Person myAge myName myParent 101 Patrick Boyle

  27. Draw what memory looks like at this point!

  28. You can’t change this!!!

More Related