Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace Delegates
- {
- class Program
- {
- static void Main()
- {
- User u = new User();
- u.Name = "Hello World";
- u.SomeFunction(); //1
- SomeFunction(u); //2
- }
- static void SomeFunction(User user) //2
- {
- Console.WriteLine(user.Name);
- }
- }
- class User
- {
- public string Name;
- public void SomeFunction() //1
- {
- Console.WriteLine(this.Name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement