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
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.
I have studied programming for 8months now and I have a firm grip on reading code and all the variables conditionals etc. and I think this class would be very hard for people never having programmed before, and for the scheme people Im sure it would be difficult for them , altogether im only on lecture 3 I hope he descibes some of the operaters etc more in depth for the noobies :)
when we say Human hum = new Human(); how much memory is allocated? (int + string)*2 ? because "hum" is of human type and new creates another object of Human type which hum refers to?
34:54 I think its wrong to say that kayla got copied to this? cause if the value of age and name of "this" change in the method then even the age and name of kayla gets changed?
I think that is the question answered at 47:40 ? or is that, object is copied into the method when its called as "this" and when the method exits the original object refers back to this ?
@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.
obviously it's only a pedagogical example made to briefly illustrate the topic he was talking about before that; and by the way introduce the student with the language.
The only point to do that is to make a simple example of a copy. (as it happens with String when you call the copy constructor)
@comwizzz123 maybe you have a student who has changed his address and phone number and certain stuff....so just copy the new details to the old persons object...but wait that doesnt make sense cause why wouldn't you want to change the fields and data right there in the persons object right lol so yeah im with you i dont know why
Prof. Shewchuk, where have you been all my semester!!!!
This is wonderful! I'm bashing my head in with a text book, feeling like a low grade maroon (sic) about writing classes in particular....This really brings the subject alive!!!
Im seriousl thinkng about going to berkly. I like how they move the classes forward and don't waste alot of time. Does anybody know what languages they teach? Ive had a couple c# classes as well as java. Weird there teaching this stuff in Data Structures. Maybe they break it up in two classes. This stuff seems a little simple for Data Structures.
I'm so glad to be IN his class. BAHAHA.
bliu94539 2 weeks ago in playlist Berkeley CS61B
he never created a Human Object that is referenced by Rishi, yet used in method copy... what gives
fatabass 2 weeks ago
rishi is an indian name.this shows that indians r rocking in UCB also :P
neil8811 2 months ago
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.....
joeshmoe005 3 months ago
He's good. I'd like him to develop his Malkovichian (John Malkovich) persona more finely, however.
syncopowerstations 4 months ago
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
sabasania 6 months ago
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.
kimoloveals 6 months ago 2
Good video.
jasperwillis5385 7 months ago
I like this video.
claircote4416 7 months ago
This video is good.
liang8231 7 months ago
Great lecture.
minami935 7 months ago
Wow that blackboard would be annoying haha
JJboy1992 7 months ago
this.professor is awesome... :)
TheGrahamBrechin 7 months ago
Look at all those late people!
Gtfokitty 10 months ago
I have studied programming for 8months now and I have a firm grip on reading code and all the variables conditionals etc. and I think this class would be very hard for people never having programmed before, and for the scheme people Im sure it would be difficult for them , altogether im only on lecture 3 I hope he descibes some of the operaters etc more in depth for the noobies :)
99SintaX 10 months ago
This has been flagged as spam show
online Latino women dating site here rockmycity.info
vishakarethiva 1 year ago
This has been flagged as spam show
try your sweet girl naneedj.info
siththee 1 year ago
This is a great professor. Me 2 wish 2 get into UCB...
icemann12489 1 year ago
when we say Human hum = new Human(); how much memory is allocated? (int + string)*2 ? because "hum" is of human type and new creates another object of Human type which hum refers to?
rsaiprasad 1 year ago
34:54 I think its wrong to say that kayla got copied to this? cause if the value of age and name of "this" change in the method then even the age and name of kayla gets changed?
I think that is the question answered at 47:40 ? or is that, object is copied into the method when its called as "this" and when the method exits the original object refers back to this ?
rsaiprasad 1 year ago
@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.
fatabass 2 weeks ago
@fatabass I meant : "this points to, not this point so"
fatabass 2 weeks ago
that teacher has a really awesome attractive personality n style he surely rocks
maiiroo 1 year ago
great teacher, he's got class
programmer1905 1 year ago
Great lecture!
trc777 1 year ago
This has been flagged as spam show
Urodzeni Mordercy - 80.72.33.238:27600
Najlepszy z ranku otrzymuje admina(do kolejnego restartu)
Życzę miłej zabawy i dużo fragów.
Kontakt: 11635462
ziebamat 2 years ago
This has been flagged as spam show
that dudes hella bald
ttto 2 years ago
I wish I could have the money to go the UCBerkeley these proffesor is awesome.....
RAIZHW 2 years ago 31
@RAIZHW lmao well judging by your grammar, you could never get in...
joeshmoe005 3 months ago
good good.
chaniwie 2 years ago
what is really the point of copying someone else's personal details into another?? :-s
comwizzz123 2 years ago
obviously it's only a pedagogical example made to briefly illustrate the topic he was talking about before that; and by the way introduce the student with the language.
The only point to do that is to make a simple example of a copy. (as it happens with String when you call the copy constructor)
Lioobayoyo 2 years ago
@comwizzz123 maybe you have a student who has changed his address and phone number and certain stuff....so just copy the new details to the old persons object...but wait that doesnt make sense cause why wouldn't you want to change the fields and data right there in the persons object right lol so yeah im with you i dont know why
pagola 11 months ago
Prof. Shewchuk, where have you been all my semester!!!!
This is wonderful! I'm bashing my head in with a text book, feeling like a low grade maroon (sic) about writing classes in particular....This really brings the subject alive!!!
AnitaLife27 2 years ago 3
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
Java, he es teaching Java.
zugelmm 2 years ago
Im seriousl thinkng about going to berkly. I like how they move the classes forward and don't waste alot of time. Does anybody know what languages they teach? Ive had a couple c# classes as well as java. Weird there teaching this stuff in Data Structures. Maybe they break it up in two classes. This stuff seems a little simple for Data Structures.
dosattack777 2 years ago
how much does it cost to go to berkly?
dosattack777 2 years ago
stil using chalk these days ?I use markers, what sit he topic here?wjat program pls?
faridjabba 2 years ago
it has something to do with the classroom lights illuminating the board, which makes it difficult to see for a relatively large class.
interxavierxxx 2 years ago
he secretly knows abt the stalker at the bk filming this..
pengo2007 3 years ago
This comment has received too many negative votes show
Why is he wearing a tie?
shobadobs 3 years ago