C
C#7mo ago
FatherGucci

✅ [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
alex
alex7mo ago
value types are copied, so anotherFalseValue holds a value, not a reference
Angius
Angius7mo ago
anotherFalseValue will hold a copy of the data While Bool anotherBookHere = bookLocation; would hold a reference to the same book
FatherGucci
FatherGucci7mo ago
thanks for clearing that up :D! all i needed to know. @alex @ZZZZZZZZZZZZZZZZZZZZZZZZZ
alex
alex7mo ago
i believe u can close by doing /close $close
MODiX
MODiX7mo ago
Use the /close command to mark a forum thread as answered
FatherGucci
FatherGucci7mo ago
tyty