Top 1000+ Object Oriented Programming (OOP) Subject Mcqs Pdf Download Set No 09
401. How can get only one unique value of the class?
- dynamic variables
- static variables
- instance variables
- data members
402. A member function having the same name as that of a class and a ~ sign with it is called,
- Constructor
- Getter
- Setter
- Destructor
403. How encapsulation can achieve?
- Information hiding
- Least inter dependencies among modules
- Implementation independence
- All of given options
404.Question: The way of Inheritance
- pass arguments to objects of classes.
- improve data hiding and encapsulation.
- make general classes into more specific classes.
- providing class growth through natural selection.
405. The common behavior of class, we can save effort by placing the common behavior in a ___.
- Derived Class
- Base class
- Deprived Class
- Named class
406. Which of the following are advantage of OOP?
- OOP makes it easy to re-use the code.
- It provides an ability to create one user defined data type by extending the other.
- It provides the facility of defining Abstract data types through which real world entities can be defined better.
- All of the given options
407. The example of OOP is an example?
- Data Type
- Abstract Type
- User Defined Type
- None of the given
408. How class can be identified from a statement by?
- Pronoun
- Verb
- Noun
- Adverb
409.The members of a class that can be accessed without creating the object of the class is called
- Private member
- Data Member
- Public Member
- Static
410. Suppose there is an object of type Person, which of the following can be considered as one of its attributes
- Name
- Age
- Work ()
- Both Name and Age
411. How can derived class can add?
- New data members
- New member functions and new friend functions
- New constructors and destructor
- All of given
412. ____ is used to access information hidden within an object?
- Interface
- Private data members
- Private member functions
- Both public and private members
413. Given the following class
class Base {
int Age=33;
}
- Yes
- no
414.How you can improve above class with respect to accessing the field Age?
- Define the variable Age as private
- Define the variable Age as protected
- Define the variable Age as private and create a get method that returns it and a set method that updates it
- Define the variable Age as protected and create a set method that returns it and a get method that updates it
415.Which of the following overloaded operators always takes no argument ?
- 1: /
- 2: +
- 3: –
- 4: ++
416. Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 – obj2 to work correctly, if the overloaded –
- operator must
- take two arguments
- return a value
- create a named temporary object
- take four arguments
417.How can we achieve independence of internal implementation from its external interface through———–.
- Encapsulation
- Information Hiding
- Abstraction
- both encapsulation and information hiding
418.Which one of the following is not an object association? Simple Association
- Inheritance
- Aggregation
- Composition
419. How can we capture the object attributes and behavior in Object Oriented programming using?
- Class
- Function
- Data Members
- Instances
420. The return type of a constructor is?
- Integer
- Character
- Double
- No type
421. Which one of the following terms best represents the statement given below Hiding information?
- Obfuscation
- Data Mining
- Compilation
- Encapsulation
422.The process of hiding unwanted details?
- Protection
- Argumentation
- Encapsulation
- Abstraction
423.What will properties of employee in an organization
- Name
- Past experience
- Age
- Relatives
424. Hobbies in spare time Keeping in view the principle of abstraction, which of the above information the company needs to save employee’s record?
- 1: 2, 4
- 2: 1, 3, 5
- 3: 1, 2, 3
- 4: 1, 2, 3, 4
425.What will the concept of derived class?
- inheritance
- encapsulation
- structure
- array
426.Which construct is the source for the creation of an object?
- Destructor of the class
- New operator
- Delete operator
- Constructor of the class
426.When a variable is defined as static in a class then all object of this class,
- Have different copies of this variable
- Have same copy of this variable
- Cannot access this variable
- None of given
427.The life of sub object is not dependent on the life of master class in?
- Composition
- Aggregation
- Separation
- None of the given
428.Which one is not keyword in C++?
- operator
- const
- B_OP
- None of given
429.Template provides a convenient way to make a family of
- variables and data members
- functions and classes
- classes and exceptions
- programs and algorithms
430. Which one of the following terms must relate to polymorphism?
- Static allocation
- Static typing
- Dynamic binding
- Dynamic allocation
431. What is true about function templates?
- The compiler generates only one copy of the function template
- The compiler generates a copy of function respective to each type of data
- The compiler can only generate copy for the int type data
- None of the given
432. Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implement on different data types?
- Templates
- Overloading
- Data hiding
- Encapsulation
433. Assume a class Derv that is privately derived from class Base. An object of class Derv located in main () can access
- public members of Derv
- protected members of Derv
- private members of Derv
- protected members of Base
434. In order to define a class template, the first line of definition must be:
- template <type name T>
- type name <template T>
- Template Class <Class Name>
- Class <Template T>
435. When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using _____).
- scope resolution operator
- dot operator
- null operator
- Operator overloading
436.Which part of an object exhibits its state?
- Data
- Operations
- Any public part
- Any private part
437.Inheritance is a way to?
- organize data.
- pass arguments to objects of classes.
- add features to existing classes without rewriting them.
- improve data-hiding and encapsulation.
438. Suppose you have been given the following design,
“A person has a name, age, address and sex. You are designing a class to represent a type of person called a patient. This kind of person may be given a diagnosis, have a spouse and may be alive”. Given that the person class has already been created, what of the following would be appropriate to include when you design the patient class?
- registration date and diagnosis
- age and sex
- sex and diagnosis
- diagnosis and age
439.What problem (s may occur when we copy objects without using deep copy constructor?
- Dangling pointer
- Memory Leakage
- All of the given
- System crash
440.these pointers are not accessible for static member functions?
- True
- False
441.A static member function cannot be declared?
- Static
- Implicit
- Explicit
- Virtual
442.remain in memory even when all objects of a class have been destroyed?
- Static variables
- Instance variable
- Primitive variables
- None of given
443.Friend functions are?
- functions of a class.
- None of given
- object member
- non-member
- data member
444. Which means if A declares B as its friend, it does NOT mean that A can access private data of B. It only means that B can access all data of A?
- Friendship is one way only
- Friendship is two way only
- NO Friendship between classes
- Any kind of friendship
445.The statement objA=objB; will cause a compiler error if the objects are of different classes?
- True
- False
446.Identify which of the following overloaded operator function’s declaration is appropriate for the given call?
- Rational_number_1 + 2.325
- Where Rational_number_1 is an object of user defined class Rational_number.
- Rational_number operator+ (Rational number & obj
- Rational_number operator+ (double& obj;
- Rational_number operator+ (Rational_number &obj, double& num;
- operator+ (double& obj;
447.Which operator cannot be overloaded?
- The relation operator (>=
- Assignment operator (=
- Script operator ([]
- Conditional operator (?
448.To convert from a user-defined class to a basic type, you would most likely use?
- a built-in conversion operator.
- a one-argument constructor.
- an overloaded = operator.
- a conversion operator that’s a member of the class.
449.The technique in which we visualize our programming problems according to real life’s problems is Called?
- structured programming
- object oriented Programming
- procedural programming
- none of the given
450.In object orientated programming, a class of objects can properties from another class of objects?
- Utilize
- Borrow
- Inherit
- Adopt