Event Driven Handouts 1 & 2

Event Driven Handouts 1 & 2

University

•

45 Qs

quiz-placeholder

Similar activities

Post test Keamanan Jaringan

Post test Keamanan Jaringan

University

•

40 Qs

Soal WAN Tkj kls 2

Soal WAN Tkj kls 2

University

•

41 Qs

UH 1

UH 1

University

•

50 Qs

2nd C Programming Quiz

2nd C Programming Quiz

University

•

50 Qs

Microsoft Excels: Formulas and Functions

Microsoft Excels: Formulas and Functions

12th Grade - University

•

45 Qs

Tree dan Graph

Tree dan Graph

University

•

50 Qs

Class Test 1 - CSE 443 (Mobile Telecommunication)

Class Test 1 - CSE 443 (Mobile Telecommunication)

University

•

40 Qs

OS Quiz 2 LH18

OS Quiz 2 LH18

University

•

45 Qs

Event Driven Handouts 1 & 2

Event Driven Handouts 1 & 2

Assessment

Quiz

•

Computers

•

University

•

Practice Problem

•

Easy

Created by

Diane Manguera

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

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

45 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is a delegate in C#?

a) A class in .NET used to encapsulate methods.

b) A reference type that holds a method reference.

c) A feature to manage events automatically.

d) An object for storing string values.

Answer explanation

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is required for a method to be referenced by a delegate?

a) The method must be public.

b) The method's signature must match the delegate's signature.

c) The method must be static.

d) The method must not take any parameters.

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the correct syntax for declaring a delegate?

a) delegate void DelegateName();

b) public event DelegateName();

c) public delegate DelegateName();

  • d) public delegate int DelegateName(int x, int y);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you invoke a delegate in C#?

a) DelegateName.Invoke();

b) delegateInstance(10, 20);

c) delegate.Invoke(10, 20);

  • d) delegateInstance();

5.

MULTIPLE CHOICE QUESTION

20 sec • 3 pts

True or False: A delegate can reference multiple methods at once.

True

False

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

In the example below, which delegate is valid for referencing the method CalculateSum(int x, int y) that returns an integer?

a) public delegate void CalculateSumDelegate(int x);

b) public delegate int CalculateSumDelegate();

c) public delegate int CalculateSumDelegate(int x, int y);

  • d) public delegate string CalculateSumDelegate(int x, int y);

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which statement correctly instantiates a delegate for the GetSum method?

a) CalculateDelegate sumDelegate = new CalculateDelegate(GetSum);

b) CalculateDelegate sumDelegate += GetSum;

c) delegate sumDelegate = GetSum;

  1. d) new CalculateDelegate sumDelegate(GetSum);

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?