[ad_1]
I am making an attempt to know c# specification model 7.0 and i am presently caught making an attempt to know the definition of “operate members”. In Chapter 7.4 about members, it was mentioned
Namespaces and kinds have members. Members of a sort are both declared within the kind declaration or inherited from the bottom class of the kind.
Chapter 7.4 clarify what’s namespace members, class members, and many others, however didn’t clarify what’s “operate members”. In Chapter 12.6 about Operate members, it was mentioned
Operate members are members that include executable statements. Operate members are all the time members of sorts and can’t be members of namespaces. C# defines the next classes of operate
members:
• Strategies
• Properties
• Occasions
• Indexers
• Person-defined operators
• Occasion constructors
• Static constructors
• Finalizers
I assumed that “operate member” is something that’s written inside a operate, nevertheless it doesn’t match with the definition in chapter 12.6. For instance, why is Finalizers a operate members ? operate just isn’t a category and so we will not write finalizers inside a operate as demonstrated under
utilizing System;
public class HelloWorld
{
void check() {
void test_one() {
Console.WriteLine("test_one()");
}
test_one();
Console.WriteLine("check()");
~HelloWorld() { // error CS1002: ; anticipated
Console.WriteLine("~HelloWorld() inside check()")
}
}
public static void Essential(string[] args)
{
Console.WriteLine("Essential()");
HelloWorld exampleObj = new HelloWorld();
exampleObj.check();
}
}
Finalizers is a operate members, however declaring finalizers inside a operate throws error as demonstrated above.
Can somebody please assist me clear this confusion? what precisely is a “operate members” ?
I attempted to google “c# operate members” however google search end result provides “members operate” as an alternative which is a distinct factor, so i have not discovered the reply on google.
[ad_2]