36 Java Object Reference Preservation |

preview_player
Показать описание
"Learn How To Design + Code A Complete App From Scratch To Playstore"
-~-~~-~~~-~~-~-

This Object Oriented Java Tutorial video talks about how object references allow instance variables to be modified but themselves are devoid of modification by reassignment to null values or other objects.

OUR WEBSITE

OUR SOCIAL LINKS
Follow us on
Рекомендации по теме
Комментарии
Автор

Isn't it the same as:

A obj1 = new A();
A obj2 = obj1;
obj2 = null;

? Basically when you are calling a method, what happens is that the value of the parameter is assigned to the value of argument (parameter = argument). Speaking of references, parameter and argument would be 2 seperate pointers (like obj1 and obj2 in the above example), pointing to the same memory location (object). And if one reference is assigned to null (or reassigned), it means that it's not pointing to any object anymore (or pointing to another object), but that does nothing to the other pointer (in other words, obj2 = null doesn't do anything with obj1, obj1 will still point to the old object). Isn't it the same as your example? I mean all you did is this with a method? If what I am saying has at least a bit sense, why is there a need for any security stuff since this is kind of a built-in thing that goes by the starting theory of references?

Anyway, awesome tutorials and explanations, not too many YouTubers explain these stuff so detailed!

vladimirsivcev
Автор

what is B obj in
class A{
public void methodA (B obj)    means  ?

steffyjoseph
Автор

So if i understood it correctly:
1) Primitive types are always passed by value.
2) For non-primitive types, the *adress* is passed by value, so by using that adress you will basically be using that object as if it had been passed by reference. you are not *actually* passing the object by reference, you are just using the adress, which is passed by value.
Is this right?

chrism
Автор

Thanks,
but i need your advice for best java book to study

ناجيابوبركة
Автор

Very useful videos sir !! God bless u :-) (y) .... but where i can find Array tutorials ?

vivekvarshney
Автор

hi vivz please upload some practical project tuts on this .. i have learned a lot from this tut . like using static variable, this,Reference Preservation, implicit nd explicit function etc on this on ur projects .. :-)

asifzafar
Автор

When i write this code my netbeans throw nullpointexception why your code running?

guardrepresenter
Автор

hello vivz, , , what is the conclusion after all??? Let me we can never provide null to an object variable throughout the whole program.... else it will be ignored....is that????

VishambarPandey
Автор

237 FREE Java slides!!!
These slides teach you everything you need to get started with Java programming. I will be adding a PART 3 in addition to the two parts that will cover more complex topics. I was so excited with these that I couldn't wait to upload it ASAP!

slidenerd
Автор

Thanks..Really it is too nasty topic ..i wasted my whole sunday to understand it..like this there are many nasty things to cover in Java...I'll be wait for those things without scratching my head too much ..

azkasaman
visit shbcf.ru