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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

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%

Prime Video

PrepInsta Prime Video

Complete Video Course for Wiley Edge

(For Wiley Edge)
Get Prime Video

Prime

PrepInsta Mock

Complete Mock subscription for Wiley Edge

(For Wiley Edge)
Get PrepInsta Mock
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