Properties

Question 1
Which of the following operator(s) cannot be overloaded?
A
. (Member Access or Dot operator)
B
?: (Ternary or Conditional Operator )
C
:: (Scope Resolution Operator)
D
All of the above
Question 1 Explanation: 
. (Member Access or Dot operator), ?: (Ternary or Conditional Operator ) and :: (Scope Resolution Operator) are ternary operators. It can’t be overloaded.
Question 2
The built-in base class in Java, which is used to handle all exceptions is
A
Raise
B
Exception
C
Error
D
Throwable
Question 2 Explanation: 
Throwable class is the built-in base class used to handle all the exceptions in Java.
Question 3
An operation can be described as:
A
Object behavior
B
Functions
C
Class Behavior
D
(A),(B)
Question 3 Explanation: 
An operation is class and object behavior
Question 4
Object oriented inheritance models:
A
"is a kind of" relationship
B
"has a" relationship
C
"want to be" relationship
D
"contains" of relationship
Question 4 Explanation: 
Generalization--> "is a kind of" relationship. It is used for object oriented inheritance models.
Aggregation-->"Has a" relationship
Question 5
Control Structures include
A
iteration
B
rendezvous statements
C
exception statements
D
all of these
Question 5 Explanation: 
● A control structure is a block of programming that analyzes variables and chooses a direction in which to go based on given parameters.
● The term flow control details the direction the program takes (which way program control "flows").
● Hence it is the basic decision-making process in computing; flow control determines how a computer will respond when given certain conditions and parameters.
Question 6
In object oriented design of software, objects have
A
attributes and name only
B
operations and name only
C
attributes name and operations
D
mutation and permutation property
Question 6 Explanation: 
● Object-oriented design is the process of planning a system of interacting objects for the purpose of solving a software problem.
● An object contains encapsulated data and procedures (operations) grouped together to represent an entity. The 'object interface' defines how the object can be interacted with.
Question 7
Which one of the following are essential features of object oriented language?
  1. Abstraction and encapsulation
  2. Strictly-typed
  3. Type-safe property coupled with sub-type rule
  4. Polymorphism in the presence of inheritance
A
A and B only
B
A, D and B only
C
A and D only
D
A, C and D only
Question 7 Explanation: 

Question 8
Give the output
#include
using namespace std;
class Base
{
Public:
int x,y;
Public:
Base(int i, int j)
{
x=i;y=j;
}
};
class Derived:public Base
{
public:
Derived(int i,int j):x(i),y(j){}
void print()
{
cout< };
int main(void)
{
Derived q(10,10);
q.print();
return 0;
}
A
1010
B
compile error
C
00
D
None of the option
Question 8 Explanation: 
We can’t directly assign the base class members by using​ ​ initializer list​ in the derived class
We should call the base class constructor in order to initialize base class members.
Question 9
If the objects focus on the problem domain, then we are concerned with
A
Object Oriented Analysis
B
Object Oriented Design
C
Object Oriented Analysis and design
D
None of the above
Question 9 Explanation: 
→ The purpose of any analysis activity in the software life cycle is to create a model of the system's functional requirements that is independent of implementation constraints.
→ The main difference between object-oriented analysis and other forms of analysis is that by the object-oriented approach we organize requirements around objects, which integrate both behaviors (processes) and states (data) modeled after real world objects that the system interacts with. In other or traditional analysis methodologies, the two aspects: processes and data are considered separately.
→ For example, data may be modeled by ER diagrams, and behaviors by flow charts or structure charts.
Question 10
Is null an object?
A
yes
B
No
C
Sometimes yes
D
None of these
Question 10 Explanation: 
If null were an Object, it would support the methods of java.lang.Object such as equals().
However, this is not the case - any method invocation on a null results in a NullPointerException.
There is also a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type
Question 11
Which of these events will be generated if we close an applet's window?
A
ActionEvent
B
ComponentEvent
C
AdjustmentEvent
D
WindowEvent
Question 11 Explanation: 
A low level event that indicates that a window has changed its status. This low-level event is generated by a Window object when it is opened, closed, activated, deactivated, iconified, or deiconified, or when focus is transferred into or out of the Window.
Question 12
Which of the following object types are generally autonomous, meaning that they can exhibit some behavior without being operated upon by another object.
A
Passive
B
Active
C
Both A) and B)
D
None of the mentioned
Question 12 Explanation: 
● An active object is one that encompasses its own thread of control.
● Active objects are generally autonomous, meaning that they exhibit some behaviour without being operated upon by another object
● Passive objects can only undergo a state change when explicitly acted upon
Question 13
What is 'basis of Encapsulation'?
A
Object
B
Class
C
Method
D
All of the above
Question 13 Explanation: 
Encapsulation is the mechanism that binds together code and data it manipulates, and keeps both safe from outside interface and misuse. Class, which contains data members and methods is used to implement Encapsulation.
Question 14
Runtime polymorphism is achieved by _____
A
Friend function
B
Virtual function
C
Operator overloading
D
Function overloading
Question 14 Explanation: 
→ In Run time Polymorphism, call is not resolved by the compiler.
→ Run time Polymorphism is achieved by virtual functions and pointers.
→ Compile time Polymorphism achieved by function overloading and operator overloading.
Question 15
Usually pure virtual function
A
Has complete function body
B
Will never be called
C
Will be called only to delete an object
D
Is defined only in derived class
Question 15 Explanation: 
→ A virtual function or virtual method is an inheritable and overridable function or method for which dynamic dispatch is facilitated.
→ A pure virtual function or pure virtual method is a virtual function that is required to be implemented by a derived class if the derived class is not abstract.
Question 16
Use of virtual function implies____
A
Overloading
B
Overriding
C
Static binding
D
Dynamic binding
Question 16 Explanation: 
→ A virtual function or virtual method is an inheritable and overridable function or method for which dynamic dispatch is facilitated.
→ Dynamic binding occurs when a pointer or reference is associated with a member function based on the dynamic type of the object.
→ The member function that is dynamically bound must override a virtual function declared in a direct or indirect base class.
Question 17
Additional information sent when an exception is thrown may be placed in___
A
Additional information sent when an exception is thrown may be placed in___
B
The function that caused the error
C
The catch block
D
An object of the exception class
Question 17 Explanation: 
→ A catch block is where you handle the exceptions, this block must follow the try block.
→ A single try block can have several catch blocks associated with it. You can catch different exceptions in different catch blocks.
→ When an exception occurs in try block, the corresponding catch block that handles that particular exception executes
Question 18
Which of the following is not true in case of public inheritance in c++?
A
Each public member in the base class is public in the derived class
B
Each protected member in the base class is protected in the derived class
C
Each private member in the base class remains private in the base class
D
Each private member in the base class remains private in the derived class
Question 18 Explanation: 
→ Public Inheritance − When deriving a class from a public base class, public members of the base class become public members of the derived class and protected members of the base class become protected members of the derived class.
→ A base class's private members are never accessible directly from a derived class, but can be accessed through calls to the public and protected members of the base class. We can summarize the different access types according to - who can access them in the following way −

There are 18 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access