UPDATED Exam Questions and CORRECT
Answers
What are the characteristics of good software? - CORRECT ANSWER - Robust/Reliable
Flexible/Adaptable
Extendable
Reusable
To design a software with all of the characteristics of good software, what principles do you need
to utilize? - CORRECT ANSWER - Object-Oriented
What is it called when you have 2+ functions of the same name but different parameters? -
CORRECT ANSWER - Overloading functions
What do you call the input of a function? - CORRECT ANSWER - Parameters
What is a blueprint for representing various concepts / is abstract? - CORRECT
ANSWER - Classes
What is an instance of a class / is concrete? - CORRECT ANSWER - Objects
What do we use to initialize the state of a class that has the same name as the class and no return
type? - CORRECT ANSWER - Constructor
When no constructor is provided, the compiler automatically creates a constructor with no
argument. What is this constructor called? - CORRECT ANSWER - Default constructor
How many bytes do character types take? - CORRECT ANSWER -4
, How many bytes do int types take? - CORRECT ANSWER -4
How many bytes do long types take? - CORRECT ANSWER -8
How many bits do bytes contain? - CORRECT ANSWER -8
What would int* p = &i store? - CORRECT ANSWER - The address of i
What would int* r = p + 1 store where the value stored in p is 100 and the address of p is 112? -
CORRECT ANSWER - 104 (adds the address of p (100) and 1 (4 bytes) = 104)
What would int l = *r store? - CORRECT ANSWER - The value at the address stored in r
What can we use to fetch the value at the address that a pointer is pointing to (ex: int x = *y) -
CORRECT ANSWER - Dereferencing a pointer
What data types are stored in stack memory? - CORRECT ANSWER - Primitive types
(int, float, double, boolean)
What data types are stored in heap memory? - CORRECT ANSWER - User defined types /
Object references
What type of function calls itself? - CORRECT ANSWER - Recursive function
Whenever a function is called, memory will be allocated in the stack for the variables. What
happens to the memory when the method returns? - CORRECT ANSWER - The memory
gets deleted