Q) Correct way of creating an object of a class called Car is
- Car obj;
- Car *obj = new Car();
- Only B
- A & B both
Answer: 4
Both Car obj; and Car *obj = new Car() are valid way to create an object of the class.
Q) In C++, Class object created statically(e.g. Car obj; and dynamically (Car *obj = new Car() ; ) are stored in memory
- Stack, heap
- Heap, heap
- Heap, stack
- Stack, stack
Answer: 1
Q) True statement about Class and structure in C++ is
- Default access specifier is private in class and public in structure
- Way of creating objects of class and structure are different
- Way of inheriting class and structure are different
- None
Answer: 1
Q) In C++ programming, cout is a/an
- Function
- Operator
- Object
- macro
Answer: 3
Q) Which is Abstract Data Type in C++
- Class
- Int
- Float
- array
Answer: 1