Am i passing values or adresses? [Java]
- by Samuel
Hello World,
I am new to java and i was asking myself, if i have a class 'Example' and somewhere i make a:
Example example1 = new Example();
and i add some stuff to it, lets say example1.setExampleBoolean(false); and now i make:
Example example2 = example1;
example2.setExampleBoolean(true);
Did i say with Example example2 = example1 let example2 point to the same adress as example1? Because than i would have altered example1.
In other words would, using something like:
Boolean exampleBoolean = example1.getExampleBoolean();
exampleBoolean be true of false?
Might be a stupid questions but for me it would change the way i'd handle problems in my programs :)
Thanks in advance
-Samuel