Question: QUESTION 7 Which of the following creates a pointer variable? MagicBox> * myBoxPtr; All of these MagicBox> myBoxPtr; MagicBox> myBoxPtr; QUESTION 8 What will

QUESTION 7 Which of the following creates a pointer variable? MagicBox> * myBoxPtr; All of these MagicBox> myBoxPtr; MagicBox> " myBoxPtr; QUESTION 8 What will happen when this code segment runs? MagicBox aMagicPtr; aMagicPtr->getItem(); The program will not compile. The getltem method will return a garbage value. The memory address of the object will be returned. The program will crash. QUESTION 9 What are two situations when automatic memory management and early binding are insufficient? 1. You don't need to access an object in the function or method that creates it. 2. You want to take advantage of data hiding. 1. You need to access an object outside of the function or method that creates it. 2. You want to take advantage of inheritance. 1. You need to access an object outside of the function or method that creates it. 2. You want to take advantage of polymorphism. 1. You need to access an object in the function or method that creates it. 2. You want to take advantage of polymorphism. QUESTION 10 Which code segment correctly creates an alias to one of the game box objects? ToyBox string > * a ToyBoxPtr = new ToyBox string >(); ToyBox anotherToyBoxPtr = aToyBoxPtr; ToyBox string aToyBoxPtr = new ToyBox string >(); ToyBox string aToyBoxPtr = anotherToyBoxPtr; ToyBox string aToyBoxPtr = new ToyBox string >(); ToyBox string > * anotherToyBoxPtr = new ToyBox string >(); aToyBoxPtr = anotherToyBoxPtr; ToyBox string > aToyBoxPtr = new ToyBox string >(); ToyBox string anotherToyBoxPtr = new aToyBoxPtr string > ()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
