PRG521 Chap8

PRG521 Chap8

University

8 Qs

quiz-placeholder

Similar activities

Router Deviec

Router Deviec

University

10 Qs

iGCSE ICT: Chapter 1

iGCSE ICT: Chapter 1

KG - University

12 Qs

Use Case Model

Use Case Model

University

10 Qs

Encapsulación PPP

Encapsulación PPP

University

7 Qs

Module 3-Creating Vlans

Module 3-Creating Vlans

9th Grade - University

12 Qs

Intro to Linux Network Management Quiz

Intro to Linux Network Management Quiz

University

10 Qs

Activity 7: Quiz

Activity 7: Quiz

University

10 Qs

Unit 6 Website Starter

Unit 6 Website Starter

University

6 Qs

PRG521 Chap8

PRG521 Chap8

Assessment

Quiz

Computers

University

Hard

Created by

Lethabo Chigo

Used 1+ times

FREE Resource

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

8.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

What is the benefit of using default interface members in C#?

They improve performance by reducing method lookup time

They allow interfaces to inherit from classes

They provide backward compatibility with older versions of C#

They enable interfaces to include method implementations without breaking existing implementations