CS 61B Lecture 3: Defining Classes
Top Comments
All Comments (43)
-
I'm so glad to be IN his class. BAHAHA.
-
@fatabass I meant : "this points to, not this point so"
-
@rsaiprasad what he is saying is correct. this point so whatever kayla is pointing to. when you play with something that "this" points to, it means the object that was pointed to by kayla has changed as well.
-
he never created a Human Object that is referenced by Rishi, yet used in method copy... what gives
-
rishi is an indian name.this shows that indians r rocking in UCB also :P
-
@RAIZHW lmao well judging by your grammar, you could never get in...
-
excellent lecture. really wish i had the money to go to a private school like this!
all my classes seem to be taught by bumbling / apathetic idiots sigh.....
-
He's good. I'd like him to develop his Malkovichian (John Malkovich) persona more finely, however.
-
no because in Java Strings are immutable,there value can't b changed once they r initialized
String s1="1";
String s2=s1; //Now both s1 and s2 point to one object with the value "1"
s1="2"; //Now s1 points to an object with the value "2", while s2 is still "1"
This happens because the statement (s1 = "2") doesn't change the value of the String object they point to,but instead,it creates new String object with the value "changed" and changes s1 so that it points to that new object.
-
wont u get a privacy leak with name=name.original, now original.name and newhumanobject.name refer to same String object, so either way, u can access and modify e.g. original.name=new String("Tom") and now newHumanobject.name and original.name both contain reference to a String object Tom, though we intended to modify only one, i.e. original.name



I wish I could have the money to go the UCBerkeley these proffesor is awesome.....
RAIZHW 2 years ago 31
This guy is a great tutor, I wish that I had the chance to go to uni and sit in on these lectures.
dankadence 2 years ago 16