Sealed vs Virtual in C#

Sealed vs Virtual in C#

12th Grade

23 Qs

quiz-placeholder

Similar activities

Professionalism in Robotics Engineering Final Assessment

Professionalism in Robotics Engineering Final Assessment

9th Grade - University

20 Qs

Latihan Soal Management

Latihan Soal Management

12th Grade

20 Qs

Python Library Routines Quiz

Python Library Routines Quiz

10th Grade - University

18 Qs

Ulangan Harian Digital Marketing

Ulangan Harian Digital Marketing

12th Grade - University

20 Qs

QUIZ 2 (FINALS)

QUIZ 2 (FINALS)

12th Grade

20 Qs

Pemanfaatan Teknologi AI dalam Pendidikan

Pemanfaatan Teknologi AI dalam Pendidikan

12th Grade

20 Qs

FASE E. KK 3. Dedicated server hosting

FASE E. KK 3. Dedicated server hosting

12th Grade

20 Qs

Quiz 1 on Artificial Intelligence

Quiz 1 on Artificial Intelligence

12th Grade

20 Qs

Sealed vs Virtual in C#

Sealed vs Virtual in C#

Assessment

Quiz

Information Technology (IT)

12th Grade

Practice Problem

Hard

Created by

Praise A

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

23 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The virtual keyword in C# indicates that a method:

Can be overridden by a derived class

Cannot be overridden

Must be implemented by every subclass

Is only accessible within the same assembly

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The purpose of a virtual method is to:

Provide a default implementation that derived classes can change

Force all derived classes to implement the method

Prevent inherited classes from accessing the method

Allow only static access to the method

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following keywords is used in a derived class to replace the behavior of a virtual method?

override

base

extends

implements

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When overriding a method, what happens if you call base.MethodName()?

It creates a new instance of the base class

It calls the original implementation from the base class

It removes the overridden implementation

It hides the method from derived classes

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword prevents further overriding of a virtual or overridden method?

sealed

static

const

readonly

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if a derived class tries to override a sealed method?

The base version runs automatically

The compiler produces an error

The override is ignored silently

The override only applies at runtime

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The ability to override virtual methods in subclasses is an example of which object-oriented principle?

Polymorphism

Encapsulation

Aggregation

Composition

Create a free account and access millions of resources

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?