NET Centric Computing · Unit 2
Object-Oriented Programming and Events
Exam-focused notes for Object-Oriented Programming and Events (NET Centric Computing, BIT351): what the TU syllabus asks and how it has actually been tested, with 2 solved past questions from this unit.
What this unit covers
- Delegates and event handling
- Exception handling and error management
- Throwing and catching exceptions
- Input validation with exceptions
Throwing and catching exceptions
Differentiate between error and exception. Write a program to take the input for any five subjects and throw the exception if the given marks is negative or exceed 100.[10]
In everyday use an error is any fault in a program, but as a technical term the two words describe faults of very different severity, and the .NET framework treats them differently from Java. In .NET there is no separate Error base class. Everything that ca...
Full solved answer →Delegates and event handling
Describe the roles of delegates in event handling. Illustrate the use of partial class with an example.[10]
--- A delegate is a type-safe function pointer in C that holds a reference to a method (or multiple methods) with a matching signature. It acts as an intermediary between the event source (publisher) and the event handler (subscriber). Syntax: --- Event han...
Full solved answer →Make Unit 2 stick
Practice BIT351 with flashcards & quizzes