What is a Delegate?
Basically a function pointer, but are type safe.
Type safe = A delegate which is pointing to a return type of int cannot point to a return type of string.
A placeholder for a/some method(s).
It is a reference to a function/method. The function is attached to the delegate and will then can be called via the delegate object.
Similar to a function pointer, where functions can be assigned like a variable and called in the run time based on dynamic conditions.
Allow methods to be passed as parameters.
What is a Delegate?
Basically a function pointer, but are type safe.
Type safe = A delegate which is pointing to a return type of int cannot point to a return type of string.
A placeholder for a/some method(s).
It is a reference to a function/method. The function is attached to the delegate and will then can be called via the delegate object.
Similar to a function pointer, where functions can be assigned like a variable and called in the run time based on dynamic conditions.
Allow methods to be passed as parameters.
Abstraction is a process by which concepts are derived from the usage and classification of literal ("real" or "concrete") concepts.
Abstraction is a concept that acts as a super-categorical noun for all subordinate concepts, and connects any related concepts as a group, field, or category.
This Powerpoint presentation covers following topics of C Plus Plus:
Features of OOP
Classes in C++
Objects & Creating the Objects
Constructors & Destructors
Friend Functions & Classes
Static data members & functions
Abstraction is a process by which concepts are derived from the usage and classification of literal ("real" or "concrete") concepts.
Abstraction is a concept that acts as a super-categorical noun for all subordinate concepts, and connects any related concepts as a group, field, or category.
This Powerpoint presentation covers following topics of C Plus Plus:
Features of OOP
Classes in C++
Objects & Creating the Objects
Constructors & Destructors
Friend Functions & Classes
Static data members & functions
Anonymous types use the keyword var. Var is also used in Pascal and Delphi today, but var in Delphi is like ByRef in Visual Basic (VB) or ref in C#. The var introduced with .NET 3.5 indicates an anonymous type. Now, our VB friends are going to think, “Well, we have had variants for years in VB.” But var is not a dumbing down and clogging up of C#. Anonymous types are something new and necessary.
Functions - C Programming
What is a Function? A function is combined of a block of code that can be called or used anywhere in the program by calling the name. ...
Function arguments. Functions are able to accept input parameters in the form of variables. ...
Function return values
Diving in OOP (Day 1) : Polymorphism and Inheritance (Early Binding/Compile T...Akhil Mittal
I have been writing a lot about advanced topics like MVC, Entity Framework, Repository Patterns etc., my priority always remains to cover the topic as a whole, so that a reader do not have to search for missing links anywhere else. My this article will cover almost every OOPS concept that a novice/beginner developer hunt for, and not only beginners, the article’s purpose is to be helpful to experience professionals also who need to sometimes brush-up their concepts or who prepare for interviews .
Most asked JAVA Interview Questions & Answers.Questpond
Java Interview Q&A video - https://youtu.be/WM351yrdlpk
In this slide we have answered definitely asked questions in JAVA interviews about Snake & Ladder game and Connection Pooling in JAVA with complete code example.
For more Basic and Advanced JAVA training videos visit this link - https://www.questpond.com/java/javaj2eedesignpattern.html
For more details contact questpond@questpond.com OR call +919967590707- 9619842789 - 9769000232.
Link to the video - https://youtu.be/BKynEBPqiIM
Get complete course from the below link :-
https://www.questpond.com/netc-fundamentals-net-collections-generics/cid22
Below is the list of Csharp interview questions covered in the video.
Question 1 :- Explain difference between .NET and C# ?
Question 2 :- .NET Framework vs .NET Core vs .NET 5.0
Question 3 :- What is IL ( Intermediate Language) Code ?
Question 4 :- What is the use of JIT ( Just in time compiler) ?
Question 5 :- Is it possible to view IL code ?
Question 6 :- What is the benefit of compiling in to IL code ?
Question 7 :- Does .NET support multiple programming languages ?
Question 8 :- What is CLR ( Common Language Runtime) ?
Question 9 :- What is managed and unmanaged code ?
Question 10 :- Explain the importance of Garbage collector ?
Question 11 :- Can garbage collector claim unmanaged objects ?
Question 12 :- What is the importance of CTS ?
Question 13 :- Explain CLS ?
Question 14 :- Difference between Stack vs Heap ?
Question 15 :- What are Value types & Reference types?
Question 16 :- Explain boxing and unboxing ?
Question 17 :- What is consequence of boxing and unboxing ?
Question 18 :- Explain casting,implicit casting and explicit casting ?
Question 19 :- What can happen during explicit casting ?
Question 20 :- Differentiate between Array and ArrayList ?
Question 21 :- Whose performance is better array or arraylist ?
Question 22 :- What are generic collections ?
Question 23 :- What are threads (Multithreading)?
Question 24 :- How are threads different from TPL ?
Question 25 :- How do we handle exceptions in C#(try/catch)?
Question 26 :- What is the need of finally?
Question 27 :- Why do we need the out keyword ?
Question 28 :- What is the need of Delegates ?
Question 29 :- What are events ?
Question 30 :- Whats the difference between Abstract class and interface ?
For more details contact questpond@questpond.com OR call +919967590707- 9619842789 - 9769000232.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
2. Delegate is defined as a pointer to a
function.
A delegate is an object that can refer to a
method.
Therefore , when you create a delegate
,you are creating an object that can hold
a reference to a method.
The delegate declaration specifies a
return type and parameter list.
3. A delegate can invoke the method to which it
refers. Thus, the method that will be invoked
by a delegate is not determined at compile
time , but rather at runtime. This is the
advantage of a delegate.
You can then initialize the variable as a
reference to any function that has the same
return type and parameter list as that
delegate.
Delegate is a communication channel, it helps
us to call back after getting the results.
4. The general form of delegate declaration
is shown here:-
Syntax:
public delegate ret-type
delegatename(parameter-list);
• ret-type is the type of value returned by the methods
that the delegate will be calling. The name of the
delegate is specified by name.
• The parameters required by the methods called
through the delegates are specified in the
parameter-list.
5. Uses of delegates:-
• Delegates allow methods to be passed as
parameters.
• Delegates can be used to define call back
methods.
• Delegates are used to pass methods as
arguments to other methods.
• Delegates are like function pointers where
input parameter and return parameter should
be same type.
6. Program:-
using System;
namespace ConsoleApplication1
{
public delegate int myDel(int a, int b)
class Program
{
static void MethodAdd(int a, int b)
{
int c= a+b;
return c;
}
static void Main(string[] args)
{
myDel obj= new myDel(MethodAdd);
int c= obj(10,6)
Console.Writeline(“addition of two no. is: “ +c);
Console.ReadKey();
}
}
}
7. Output:-
addition of two no. is: 16
Types of Delegates:
There are two types of delegate.
1. Single delegate:-
• A delegate is called simple delegate if it
invokes a single method.
• Simple delegate refer to a single method.
8. 2. Multicast delegate:-
• The Multicast delegates can invoke multiple
methods.
• Multicast delegates can send messages to
multiple clients/subscribers
• It uses += sign to broadcast multiple clients.
• It makes two way communication.
9. Program:-
using System;
namespace ConsoleApplication2
{
public delegate int myDel(int a, int b)
class Program
{
static void MethodAdd(int a, int b)
{
Console.Writeline(“The sum is: “ + (a+b));
}
static void MethodMul(int a, int b)
{
Console.Writeline(“The product is: “ + (a*b) );
}
static void Main(string[] args)
{
myDel obj= new myDel(MethodAdd);
obj += new myDel(MethodMul);
Console.ReadKey();
}
}
}