0

I'm a newbie in .net.

I saw some videos about delegate in youtube.

someone uses delegate like

 AddDelegate addDelegate = new AddDelegate(Add);

someone uses delegate like

 AddDelegate addDelegate = Add; 

I've tested 2 ways and I wasn't able to find differences between them.

I want to know what is the differencies between them.

  • 1
    https://sharplab.io/#v2:CYLg1APgAgTAjAWAFBQMwAJboMLoN7LpHEnACmANmQOYCGALmegJYB296AgsMACKU0GZABRsOADwCUAbmSESXHvyp1G6WkoGqmAXnSsyAd0V8tQ4d2Az5JS8sFqNplUJjo9l2UgXoADgCdmADchTDgANhZ2E1FoqRtiAm8fInoAC38Ae2MDYwA5TPoASQBbXyoSsnYyYABRcQBjMl96ZkzWYWtkkgBfBLRMABZ0AFlO/AS+pB6gA – TheGeneral Sep 10 '21 at 04:49
  • https://stackoverflow.com/questions/7735159/why-use-new-delegatetypedelegate – TheGeneral Sep 10 '21 at 04:57
  • It's like asking what the difference is between `Person p = new Person(); var q = new Person(); Person r = new();` – Caius Jard Sep 10 '21 at 05:23
  • They're literally identical; see linked question for a lot more context – Marc Gravell Sep 10 '21 at 06:34

0 Answers0