Home > Enterprise >  What's an umbrella term for things like class, struct, interface and enum?
What's an umbrella term for things like class, struct, interface and enum?

Time:07-08

I know what I typed are keywords, but that umbrella term would also contain things like if, new or using. Can I just call class, interface etc. types? I feel like that would be confusing because the keyword class is being used for declaring types.

CodePudding user response:

I just found out, the Microsoft documentation calls them "categories of types" here:

https://docs.microsoft.com/en-us/dotnet/standard/base-types/common-type-system?redirectedfrom=MSDN#types_in_the_net_framework

CodePudding user response:

Interfaces, classes, structs, and enums are all varieties of types in .NET.

Generally, words that are used by the language are called keywords. This would include class, interface, if, new and many others.

There isn't a term that collectively refers to the keywords that represent types (class, interface, but not if, for). I might call these "type declaration keywords".

  •  Tags:  
  • c#
  • Related