0% found this document useful (0 votes)
355 views19 pages

Test1-OOC: Total Points Test1-Object Oriented Concepts in Java

This document contains an 18 question multiple choice test on object oriented concepts in Java. The test covers topics like OOP features, constructors, inheritance, polymorphism, and access specifiers. The student scored 2 out of 40 total points on the test, answering questions 5, 6, and 17 correctly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
355 views19 pages

Test1-OOC: Total Points Test1-Object Oriented Concepts in Java

This document contains an 18 question multiple choice test on object oriented concepts in Java. The test covers topics like OOP features, constructors, inheritance, polymorphism, and access specifiers. The student scored 2 out of 40 total points on the test, answering questions 5, 6, and 17 correctly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

29/04/2020 Test1-OOC

Test1-OOC Total points 2/40

Test1-Object Oriented Concepts in Java

Name *

Google Demo

USN *

1010

Semester *

10

1. Which of the following is not an OOP feature in C++? * 0/1

a.) Encapsulation

(b.) Abstraction

(c.) Polymorphism

(d.) Exceptions

Correct answer

(d.) Exceptions

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 1/19
29/04/2020 Test1-OOC

2. If container classes are carefully constructed, then these tools are 0/1
available to work with structures that are not ______

(a.) valid without container classes

(b.) programmer-defined

(c.) type-specific

(d.) public

Correct answer

(c.) type-specific

3. To be called object-oriented, a programming language must allow: 0/1

a.) functions that return values

(b.) Library of predefined functions

(c.) Inheritance

(d.) All of these

Correct answer

(d.) All of these

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 2/19
29/04/2020 Test1-OOC

4. Which of the following statements is false? 0/1

a.) A function is a block of code that performs a specific task

(b.) Functions allow programmers to break large and complex problems into small
and manageable tasks

(c.) Functions allow programmers to use existing code to perform common tasks

(d.) Functions can be called, or invoked, only once in a program

Correct answer

(d.) Functions can be called, or invoked, only once in a program

5. A function that is called automatically each time an object is destroyed 1/1


is a

a.) Destructor

(b.) Destroyer

(c.) Remover

(d.) Terminator

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 3/19
29/04/2020 Test1-OOC

6. The #ifndef directive tests to see whether ________ 1/1

a.) A class has been defined

(b.) A variable has been assigned a value

(c.) A class has no variable definitions

(d.) Any objects of the class have been instantiated

Feedback

7. Which of the following is not a type of constructor? 0/1

(a.) Copy Constructor

(b.) Friend Constructor

(c.) Default Constructor

(d.) Parametrized Constructor

Correct answer

(b.) Friend Constructor

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 4/19
29/04/2020 Test1-OOC

8. Which of the following concepts means determining at runtime what 0/1


method to invoke?

a.) Data hiding

(b.) Dynamic Typing

(c.) Dynamic binding

(d.) Dynamic Loading

Correct answer

(c.) Dynamic binding

Feedback

9. Which of the following is a mechanism of static polymorphism? 0/1

(a.) Operator overloading

(b.) Function Overloading

(c.) Templates

(d.) All of the above

Correct answer

(d.) All of the above

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 5/19
29/04/2020 Test1-OOC

10. Which of the following approach is adapted by C++? 0/1

a.) Top down

(b.) Bottom Up

(c.) Left right

(d.) Right Left

Correct answer

(b.) Bottom Up

Feedback

11. When the compiler cannot differentiate between two overloaded 0/1
constructors, they are called

a.) overloaded

(b.) Destructed

(c.) Ambiguous

(d.) Dubious

Correct answer

(c.) Ambiguous

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 6/19
29/04/2020 Test1-OOC

12. To expose a data member to the program, you must declare the data 0/1
member in the _____ section of the class

(a.) Common

(b.) Exposed

(c.) public

(d.) unrestricted

Correct answer

(c.) public

Feedback

13. What happens if the base and derived class contains definition of a 0/1
function with same prototype?

(a.) Compiler reports an error on compilation.

(b.) Only base class function will get called irrespective of object

(c.) Only derived class function will get called irrespective of object.

(d.) Base class object will call base class function and derived class object will call
derived class function.

Correct answer

(d.) Base class object will call base class function and derived class object will call
derived class function.

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 7/19
29/04/2020 Test1-OOC

14. Which of the following is not a type of inheritance? 0/1

(a.) Multiple

(b.) Multilevel

(c.) Distributive

(d.) Hierarchial

Correct answer

(c.) Distributive

Feedback

15. If a class C is derived from class B, which is derived from class A, all 0/1
through public inheritance, then a class C member function can access

(a.) protected and public data only in C and B.

(b.) protected and public data only in C.

(c.) private data in A and B.

(d.) public and protected data of A and B and all data of C

Correct answer

(d.) public and protected data of A and B and all data of C

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 8/19
29/04/2020 Test1-OOC

16. Which of the following keyword is used to overload an operator? 0/1

(a.) overload

(b.) operator

(c.) friend

(d.) override

Correct answer

(b.) operator

Feedback

17. Which one of the following options is correct? 0/1

(a.) Friend function can access public data members of the class.

(b.) Friend function can access protected data members of the class.

(c.) Friend function can access private data members of the class.

(d.) All of the above.

Correct answer

(d.) All of the above.

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJP… 9/19
29/04/2020 Test1-OOC

18. Which of the following access specifier is used as a default in a class 0/1
definition?

(a.) protected

(b.) public

(c.) private

(d.) friend

Correct answer

(c.) private

Feedback

19. Which of the following statements is correct ? 0/1

(a.) Classes cannot have data as protected members.

(b.) Structures can have functions as members.

(c.) Class members are public by default.

(d.) Structure members are private by default

Correct answer

(c.) Class members are public by default.

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 10/19
29/04/2020 Test1-OOC

20.When does method overloading is determined? 0/1

a) At run time

b) At compile time

c) At coding time

d) At execution time

Correct answer

b) At compile time

Feedback

21. The concept of multiple inheritance is implemented in Java by ------- ···/1


-------

Correct answer

interface

Feedback

Interface

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 11/19
29/04/2020 Test1-OOC

22. super keyword can be used to -------- ···/1

Correct answer

Can access members of parent class

Feedback

Can access members of parent class

23. A class can implement _____ interfaces ···/1

Correct answer

Any number of interfaces

Feedback

Any number of interfaces

24. Who invented OOP? ···/1

Correct answer

alan kay

Feedback

Alan kay

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 12/19
29/04/2020 Test1-OOC

25. What happens when a constructor is defined for an interface? ···/1

Correct answers

compilation error

Correct Answer

Feedback

compilation error

26. ----- is the additional feature in classes that was not in structures ···/1

Correct answer

member functions or function definition

Feedback

Member functions or function de nition

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 13/19
29/04/2020 Test1-OOC

27. Pure OOP can be implemented without using class in a program. (True 0/1
or False)

Correct answer

false

Feedback

False

28. Which Feature of OOP illustrated the code reusability? ···/1

Correct answer

inheritance

Feedback

inheritance

29. Which language does not support all 4 types of inheritance? ···/1

Correct answer

java

Feedback

java

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 14/19
29/04/2020 Test1-OOC

30 How many classes can be defined in a single program? ···/1

10

Correct answer

any number

Feedback

any number

31. When OOP concept did first came into picture? ···/1

Correct answer

1966 or 1967

Feedback

1966 or 1967

32. How many types of constructors are available for use in general (with ···/1
respect to parameters)?

10

Correct answer

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 15/19
29/04/2020 Test1-OOC

33.Default constructor must be defined, if parameterized constructor is ···/1


defined and the object is to be created without arguments(true/false)

Correct answer

true

Feedback

34. How many types of access specifiers are provided in OOP (C++)? ···/1

10

Correct answer

Feedback

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 16/19
29/04/2020 Test1-OOC

35. Which specifier allows a programmer to make the private members ···/1
which can be inherited?

Correct answer

protected

Feedback

protected

36. If a class has all the private members, which specifier will be used for ···/1
its implicit constructor?

Correct answer

public

Feedback

public

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 17/19
29/04/2020 Test1-OOC

37. If an abstract class has all the private members, then _________ ···/1

10

Correct answer

No class will be able to implement members of abstract class

Feedback

No class will be able to implement members of abstract class

38. Which specifier should be used for member functions of a class? ···/1

Correct answer

public

Feedback

public

39. What is the term used to indicate the variable and constants of a ···/1
class?

Correct answer

Data members

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 18/19
29/04/2020 Test1-OOC

40.Data members ________________ (C++) ···/1

Correct answer

Variables

Feedback

variable

This form was created inside Sir.M.Visvesvaraya Institute of Technology.

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSeeBuCmo-1r1SnmgO2-ADXN8I2OkIarsayZPOwx6Fip72vTJQ/viewscore?viewscore=AE0zAgAJ… 19/19

You might also like