Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome to CS61BL Grab lecture notes when you come in

Similar presentations


Presentation on theme: "Welcome to CS61BL Grab lecture notes when you come in"— Presentation transcript:

1 Colleen Lewis ColleenL@berkeley.edu
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

2 Announcements Reading assignments are important, but they won’t be announced in lecture. Do the reading!!! The course website: 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 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

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

14 Creates the file Person.java

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

16 Start and end the class

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

18 // TODOs are your friend
// Good looking // comment! // TODOs are your friend

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

20 Create a reference to a Person Create a Person
Set your reference to point to your object

21

22 Person myAge myName myParent 50 Susan Boyle

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

24 Draw what memory looks like at this point!

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

26 Draw what memory looks like at this point!

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

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

29 Draw what memory looks like at this point!

30 You can’t change this!!!


Download ppt "Welcome to CS61BL Grab lecture notes when you come in"

Similar presentations


Ads by Google