ZS Associate OOPs Questions and Answers Quiz-1

Question 1

Time: 00:00:00
Which was the first purely object oriented programming language developed?

Java

Java

C++

C++

SmallTalk

SmallTalk

Kotlin

Kotlin

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 2

Time: 00:00:00
What is the additional feature in classes that was not in structures?

Data members

Data members

Member functions

Member functions

Static data allowed

Static data allowed

Public access specifier

Public access specifier

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
If two classes have exactly same data members and member function and only they differ by class name. Can copy constructor be used to initialize one class object with another class object?

Yes, possible

Yes, possible

Yes, because the members are same

Yes, because the members are same

No, not possible

No, not possible

No, but possible if constructor is also same

No, but possible if constructor is also same

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00
Copy constructor will be called whenever the compiler __________

Generates implicit code

Generates implicit code

Generates member function calls

Generates member function calls

Generates temporary object

Generates temporary object

Generates object operations

Generates object operations

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
Which problem arises due to multiple inheritance, if hierarchical inheritance is used previously for its base classes?

Diamond

Diamond

Circle

Circle

Triangle

Triangle

Loop

Loop

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
Can the derived class be made abstract if multiple inheritance is used ?

No, because other classes must be abstract too

No, because other classes must be abstract too

Yes, if all the functions are implemented

Yes, if all the functions are implemented

Yes, if all the methods are predefined

Yes, if all the methods are predefined

No, since constructors won’t be there

No, since constructors won’t be there

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
If 6 classes uses single level inheritance with pair classes (3 pairs), which inheritance will this be called?

Single

Single

Multiple

Multiple

Hierarchical

Hierarchical

Multilevel

Multilevel

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
class A
{
public : class B
{
public : B(int i): data(i)
{
}
int data;
}
};
class C: public A
{
class D:public A::B{ };
};

Multi-level inheritance is used, with nested classes

Multi-level inheritance is used, with nested classes

Multiple inheritance is used, with nested classes

Multiple inheritance is used, with nested classes

Single level inheritance is used, with enclosing classes

Single level inheritance is used, with enclosing classes

Single level inheritance is used, with both enclosing and nested classes

Single level inheritance is used, with both enclosing and nested classes

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00
Which among the following is true?

Two objects can point to the same memory location

Two objects can point to the same memory location

Two objects can never point to the same memory location

Two objects can never point to the same memory location

Objects not allowed to point at a location already occupied

Objects not allowed to point at a location already occupied

Objects can’t point to any address

Objects can’t point to any address

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00
class A
{
public :int a;
}
class B:public A
{
int b;
}
main()
{
B b=new A(); //casting 1
A a=new B(); //casting 2
}

Casting 1

Casting 1

Casting 2

Casting 2

Casting 1 & Casting 2

Casting 1 & Casting 2

Casting 1 nor Casting 2

Casting 1 nor Casting 2

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.