Search Header Logo

PRG521 Chap8

Authored by Lethabo Chigo

Computers

University

Used 1+ times

PRG521 Chap8
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

What is one advantage of interfaces in C# over abstract classes?

They support multiple inheritance

They provide default implementations for methods

They allow for polymorphism without using up single-inheritance

They can directly access private members of implementing classes

2.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

In C# 8.0/.NET Core 3.0, what feature allows interfaces to provide implementations for their members?

Abstract methods

Default interface members

Extension methods

Static methods

3.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

Which of the following accurately describes the relationship between interfaces and abstract classes in C#?

Interfaces cannot have any implementation details

Interfaces can inherit from abstract classes

Interfaces can provide a superset of capabilities compared to abstract classes

Abstract classes support multiple inheritance, while interfaces do not

4.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

How does C# handle the scenario where a class implements multiple interfaces with the same method signature?

It throws a compilation error

It allows the class to implement only one of the interfaces

It requires the class to provide an explicit implementation for the method

It allows the class to implement all the interfaces with the same method signature

5.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

What determines whether the implementation of an interface member in C# is explicit or implicit?

The access modifier of the implementing class

Whether the interface is marked as 'abstract'

Whether the method is marked as 'virtual'

Whether the member is directly exposed by the class or only via a conversion to the interface

6.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

Which version of C# introduced the concept of default interface members?

C# 6.0

C# 7.0

C# 8.0

C# 9.0

7.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

In C#, what happens when a class explicitly implements an interface member?

The member cannot be accessed outside the class

The member is accessed through a conversion to the interface type

The member is accessed directly from the class instance

The member is accessible only within the same assembly

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?