✅ [SOLVED] Does the 3rd line of code hold memory as a reference or does it hold the actual value?

ayooo, quick question. pretty simple. Book is a custom class just so you know....
Book bookLocation = new Book();
Book bookLocation = new Book();
just holds the memory of the location in terms of reference for the value or object
bool falseValue = false;
bool falseValue = false;
holds the actual value of course
bool anotherFalseValue = falseValue;
bool anotherFalseValue = falseValue;
holds what??? the memory of the value location or is it considered to hold the actual value as well?
7 Replies
jen
jen2y ago
value types are copied, so anotherFalseValue holds a value, not a reference
Angius
Angius2y ago
anotherFalseValue will hold a copy of the data While Bool anotherBookHere = bookLocation; would hold a reference to the same book
GucciToilet
GucciToiletOP2y ago
thanks for clearing that up :D! all i needed to know. @alex @ZZZZZZZZZZZZZZZZZZZZZZZZZ
jen
jen2y ago
i believe u can close by doing /close $close
MODiX
MODiX2y ago
Use the /close command to mark a forum thread as answered
GucciToilet
GucciToiletOP2y ago
tyty

Did you find this page helpful?