300 likes | 323 Views
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!!!
E N D
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
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.
We can show you the world Stacking, searching and queuing Tell us, students, now when did You last see such singing staff?
We can open your minds Take you structure by structure Linked lists, arrays, and... oh, sure! Even hash sets on the side.
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.
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!)
Unbelievable code Indescribable coolness For-loops, while-loops, and do-whiles, Through an endless stream of bytes.
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
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
A whole new world That's where we'll be A thrilling chase A wondrous place For you and we
I want to make some Person objects Give me a main method!
I want to make some Person objects Everyone can make these Person objects To make objects I need a class
Method named main Everyone can call this method And they don’t need a Person first And returns nothing That takes in some arguments
// Good looking // comment! // TODOs are your friend
Instance variables. One per object! You can even have a reference to a Person
Create a reference to a Person Create a Person Set your reference to point to your object
Person myAge myName myParent 50 Susan Boyle
Constructor for a Person Set this’s instance variables Equivalent to the 3 lines before
Answer Person myAge myName myParent 50 Susan Boyle main susan patrick Person myAge myName myParent 101 Patrick Boyle
mystery this person2 main susan patrick Person myAge myName myParent 50 Susan Boyle Person myAge myName myParent 101 Patrick Boyle
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