Which of the following data types would be the best choice for keeping track of peoples ages using the least amount of memory?
Answer: A byte would be the best choice here as it uses the least amount of memory and a byte goes upto 255 which is more than enough for peoples ages.
Some data is stored on the heap while other data is stored on the stack, which of the following will be stored on the heap?
Answer: The answer is a name (string), remember strings aren’t value types. The variable itself (the reference to the string) will be stored on the stack, while the actual data in the char will be stored on the heap.
It would make sense to store one of these variables as a char, which one? *Name * Weight * Gender
View original post 364 more words