Event Driven Handouts 1 & 2

Quiz
•
Computers
•
University
•
Hard
Diane Manguera
FREE Resource
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;
d) new CalculateDelegate sumDelegate(GetSum);
Create a free account and access millions of resources
Similar Resources on Wayground
45 questions
Davinci Resolve 17 Fusion 101

Quiz
•
11th Grade - Professi...
40 questions
System Integration-Midterm Exam

Quiz
•
University
50 questions
Day 2 - Java Test (class, object, static)

Quiz
•
University
50 questions
Java Programming Quiz

Quiz
•
University
50 questions
Android Development Quiz

Quiz
•
University
50 questions
SE UNIT -2 Advanced Requirements Engineering Quiz

Quiz
•
University
40 questions
Term 2 test

Quiz
•
6th Grade - University
40 questions
Introduction to Web Systems Exam

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University