Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Method<ClassName> mean?

I've seen this syntax a couple times now, and it's beginning to worry me,

For example:

iCalendar iCal = new iCalendar(); Event evt = iCal.Create<Event>(); 
like image 244
Ian G Avatar asked Nov 20 '08 15:11

Ian G


People also ask

What does className mean?

In the HTML document, the className property is used to set or return the value of an element's class attribute. Using this property, the user can change the class of an element to the desired class.

What does className mean in Java?

Java provides a class with name Class in java. lang package. Instances of the class Class represent classes and interfaces in a running Java application. The primitive Java types (boolean, byte, char, short, int, long, float, and double), and the keyword void are also represented as Class objects.

Is method name same as class name?

Yes, It is allowed to define a method with the same name as that of a class. There is no compile-time or runtime error will occur.

Which method is called by the class name?

static methods can be called using class name and do not require an object of that class.


1 Answers

It's a Generic Method, Create is declared with type parameters, and check this links for more information:

  • An Introduction to C# Generics
  • Generics (C# Programming Guide)
  • Generic Methods
like image 138
Christian C. Salvadó Avatar answered Oct 14 '22 14:10

Christian C. Salvadó