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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

["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%

Completed

0/10

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

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.

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.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects