βœ… [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
alexβ€’13mo ago
value types are copied, so anotherFalseValue holds a value, not a reference
Angius
Angiusβ€’13mo ago
anotherFalseValue will hold a copy of the data While Bool anotherBookHere = bookLocation; would hold a reference to the same book
π”Ύπ•¦π•”π•”π•šπ•‹π• π•šπ•π•–π•₯
thanks for clearing that up :D! all i needed to know. @alex @ZZZZZZZZZZZZZZZZZZZZZZZZZ
alex
alexβ€’13mo ago
i believe u can close by doing /close $close
MODiX
MODiXβ€’13mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server