Home > Object Oriented Programming > Quizzes > Object Oriented Programming Practice Test: Memory Allocation & Scope of Variable
Object Oriented Programming Practice Test: Memory Allocation & Scope of Variable
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 74% Most missed: “If an object is allocated using new operator ____________”
Quiz questions on new and delete operators, automatic and extern variables. In object-oriented programming (OOP), memory allocation is the process of allocating memory to store the data members and functions of an object. The amount of memory required for an object depends on the size and type of its data members and the size and complexity of its member functions. In most programming languages, memory allocation for objects is done automatically when an object is created. When an object is destroyed, the memory allocated to it is automatically deallocated. The scope of a variable in OOP... Show more
Object Oriented Programming Practice Test: Memory Allocation & Scope of Variable
Time left 00:00
25 Questions

1. Which condition is true if the extern variable is used in a file?
2. Which among the following is added in grammar of new operator?
3. The automatic variables _________________________
4. Which is the correct syntax for extern variable declaration?
5. Which cases among the following produces the undefined result?
6. The new operator _____________
7. Does delete return any value?
8. Delete operator _________________
9. Initializers __________________
10. Which is the correct syntax to delete a single object?
11. Does java contain auto or register keywords?
12. If the definition is given in the header file that we include then ________________
13. If delete is applied to an object whose l-value is modifiable, then _______________ after the object is deleted.
14. The objects allocated using new operator ________________
15. For declaring data by using new operator ____________________
16. If an object is allocated using new operator ____________
17. What is extern variable?
18. Which among the following is a correct statement for variables?
19. Which among the following is true?
20. Why are functions extern by default?
21. If extern variable is initialized with the declaration then _______________________
22. What happens when new fails?
23. Which is the correct syntax to delete an array of objects?
24. How are automatic variables different from the instance variables?
25. Which error is produced if the automatic variables are used without declaration?