Home Latest Jobs Syllabus Projects Previous Question Papers Entrance Exam Notifications Multiple Choice Question

AP ECET COMPUTER SCIENCE AND ENGINEERING Multiple Choice Questions (MCQs)

MCQs for AP ECET - Object-Oriented Programming through C++

AP ECET - Object-Oriented Programming through C++ (Questions 106-120)

  1. Which of the following is not a feature of Object-Oriented Programming (OOP)?

    • a) Encapsulation
    • b) Polymorphism
    • c) Inheritance
    • d) Assembly programming

    Answer: d) Assembly programming

  2. Which of the following is used to define a class in C++?

    • a) class
    • b) structure
    • c) object
    • d) function

    Answer: a) class

  3. Which of the following operators is used for dynamic memory allocation in C++?

    • a) new
    • b) malloc
    • c) alloc
    • d) new[]

    Answer: a) new

  4. In C++, which of the following is a type of constructor?

    • a) Default constructor
    • b) Parameterized constructor
    • c) Copy constructor
    • d) All of the above

    Answer: d) All of the above

  5. What is the purpose of the this pointer in C++?

    • a) To refer to the current object
    • b) To create a new object
    • c) To access class members
    • d) To refer to base class object

    Answer: a) To refer to the current object

  6. What does the destructor in C++ do?

    • a) Initializes object
    • b) Destroys object when it goes out of scope
    • c) Creates object
    • d) None of the above

    Answer: b) Destroys object when it goes out of scope

  7. Which of the following operators can be overloaded in C++?

    • a) +
    • b) =
    • c) []
    • d) All of the above

    Answer: d) All of the above

  8. What is inheritance in C++?

    • a) A process of creating an object
    • b) A process of deriving new class from an existing class
    • c) A process of overloading functions
    • d) A process of destroying objects

    Answer: b) A process of deriving new class from an existing class

  9. Which of the following is true about virtual functions in C++?

    • a) A virtual function can be overridden in a derived class
    • b) A virtual function cannot be overloaded
    • c) A virtual function must be declared as private
    • d) Virtual functions do not support dynamic polymorphism

    Answer: a) A virtual function can be overridden in a derived class

  10. Which function is used to read data from a file in C++?

    • a) cin
    • b) scanf()
    • c) get()
    • d) ifstream::read()

    Answer: d) ifstream::read()

  11. What is the purpose of a template in C++?

    • a) To define a function or class that works with any data type
    • b) To create an abstract class
    • c) To overload operators
    • d) To create a function with default arguments

    Answer: a) To define a function or class that works with any data type

  12. Which of the following is used for operator overloading in C++?

    • a) operator
    • b) new
    • c) function
    • d) class

    Answer: a) operator

  13. Which of the following is the correct way to declare a function that returns a reference to an integer in C++?

    • a) int &function()
    • b) int function()&
    • c) function() int&
    • d) reference int function()

    Answer: a) int &function()

  14. What is the output of the following C++ code?

                    class Test {
                    public:
                        void display() {
                            cout << "Hello, World!";
                        }
                    };
    
                    int main() {
                        Test obj;
                        obj.display();
                        return 0;
                    }
                
    • a) Error in code
    • b) "Hello, World!"
    • c) "World! Hello"
    • d) "Hello"

    Answer: b) "Hello, World!"

  15. What will happen if we try to delete a pointer that was not created using new?

    • a) Memory will be freed
    • b) Runtime error
    • c) The program will crash
    • d) Nothing will happen

    Answer: b) Runtime error



    << Previous Page    l    Next Page >>

Note/Caution: studentsbizz.com does not promise a job or an interview in exchange for money. Fraudsters may ask you to pay under the pretext of a registration fee or refundable fee, but please be aware that legitimate employers will not require such payments.