Wiley Edge Java/ Python Quiz-1

Question 1

Time: 00:00:00
What is a class in programming languages like Java and Python?

A method to declare variables

A method to declare variables

A blueprint to create objects

A blueprint to create objects

A conditional statement

A conditional statement

A function that returns a value

A function that returns a value

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

Please login to submit your explanation

Question 2

Time: 00:00:00
Which keyword is used to create an object of a class?

new (Java), create (Python)

new (Java), create (Python)

instance (Java), object (Python)

instance (Java), object (Python)

object (Java), new (Python)

object (Java), new (Python)

new (Java), object (Python)

new (Java), object (Python)

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

Please login to submit your explanation

Question 3

Time: 00:00:00
What is Polymorphism in OOP?

Ability of a method to perform different tasks based on the object

Ability of a method to perform different tasks based on the object

Ability of an object to access multiple classes

Ability of an object to access multiple classes

Ability to create multiple instances of a class

Ability to create multiple instances of a class

Ability to create complex data structures

Ability to create complex data structures

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

Please login to submit your explanation

Question 4

Time: 00:00:00
Which type of polymorphism involves overloading methods within a single class?

Compile-time (Java), Static (Python) Polymorphism

Compile-time (Java), Static (Python) Polymorphism

Runtime (Java), Dynamic (Python) Polymorphism

Runtime (Java), Dynamic (Python) Polymorphism

Inheritance Polymorphism

Inheritance Polymorphism

Interface Polymorphism

Interface Polymorphism

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

Please login to submit your explanation

Question 5

Time: 00:00:00
What does Encapsulation represent in OOP?

Binding data with methods that operate on that data, preventing direct access from outside

Binding data with methods that operate on that data, preventing direct access from outside

Creating multiple instances of a class

Creating multiple instances of a class

Using inheritance to derive a new class from an existing one

Using inheritance to derive a new class from an existing one

Implementing interfaces to achieve polymorphism

Implementing interfaces to achieve polymorphism

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

Please login to submit your explanation

Question 6

Time: 00:00:00
Which access modifiers define encapsulation in Java and Python?

public and private

public and private

protected and default

protected and default

private and protected

private and protected

private and public

private and public

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

Please login to submit your explanation

Question 7

Time: 00:00:00
In Java, what is the purpose of a constructor?

To create multiple instances of a class

To create multiple instances of a class

To initialize objects of a class

To initialize objects of a class

To declare variables

To declare variables

To define the methods of a class

To define the methods of a class

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

Please login to submit your explanation

Question 8

Time: 00:00:00
In Python, how is encapsulation implemented for data members?

Using access specifiers like public and private

Using access specifiers like public and private

By defining getter and setter methods

By defining getter and setter methods

By directly accessing data members

By directly accessing data members

By using decorators

By using decorators

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

Please login to submit your explanation

Question 9

Time: 00:00:00
What is method overriding in Java?

Creating multiple methods with the same name and parameters

Creating multiple methods with the same name and parameters

Defining a method in a subclass that already exists in the superclass

Defining a method in a subclass that already exists in the superclass

Implementing an interface method

Implementing an interface method

Overloading methods within a single class

Overloading methods within a single class

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

Please login to submit your explanation

Question 10

Time: 00:00:00
How does Python indicate private attributes within a class?

By using the 'private' keyword before the attribute name

By using the 'private' keyword before the attribute name

By using a single underscore (_) before the attribute name

By using a single underscore (_) before the attribute name

By using a double underscore (__) before the attribute name

By using a double underscore (__) before the attribute name

By using the 'private' keyword after the attribute name

By using the 'private' keyword after the attribute name

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.