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
50 questions
Day 4 - Inheritance, super, final, abstract, interface

Quiz
•
University
40 questions
Quizo'24

Quiz
•
University
46 questions
CSCI0613 - Course Packet 1

Quiz
•
University
40 questions
Y10 System Architecture Review

Quiz
•
9th Grade - University
47 questions
CSC 208 MODELLING & SIMULATION MIDTERM EXAM

Quiz
•
University
40 questions
Python Final

Quiz
•
University
40 questions
9th Grade - IT Programming - 2nd Cycle Exam

Quiz
•
9th Grade - University
45 questions
Reviewer COMP 20083 - Object Oriented Programming Quiz 1

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University