Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 631997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:01:40+00:00 2026-05-13T20:01:40+00:00

MSDN defines System.Enum as an abstract class: [SerializableAttribute] [ComVisibleAttribute(true)] public abstract class Enum :

  • 0

MSDN defines System.Enum as an abstract class:

[SerializableAttribute]
[ComVisibleAttribute(true)]
public abstract class Enum : ValueType, IComparable, IFormattable, IConvertible

And also MSDN make such statement about abstract class:

An abstract class cannot be
instantiated. The purpose of an
abstract class is to provide a common
definition of a base class that
multiple derived classes can share.

But I simply cannot derive from System.Enum. According to Jeffery Richter in his book “CLR via C#”, it is C# compiler that forbid that derivation.

And I checked System.Enum’s members, most of them are static, which is reasonable for it cannot be instantiated and static methods don’t need an object instance to invoke. But there are also some instance methods, such a GetHashCode() and GetTypeCode().

So, my first question is, if System.Enum cannot
be instantiated or derived, how could
these instance methods be invoked?
Isn’t this some kind of a paradox?

I know I could use the following
approach to invoke these instance
methods, but why? Is there some kind
of System.Enum or derived type object
instance
created? When? and by whom?

public enum Days:byte { Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday };
Days d = Days.Friday;
d.GetTypeCode();
d.GetHashCode();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:01:40+00:00Added an answer on May 13, 2026 at 8:01 pm

    You can derive from Enum, e.g.

    public enum MyEnum
    {
        // ...
    }
    

    Will be compiled down to something like:

    .class public auto ansi sealed MyEnum
        extends System.Enum
    {
        // ...
    }
    

    The restriction the C# compiler places is that it won’t let you write the derivation manually, but instead requires you to use the enum keyword when declaring the type.

    As to why this is… my guess is because enumerations are a bit weird in the CLR. For example, the ValueType and Enum base types are both themselves reference types, not value types. There’s a whole bunch of magic going on under the covers, and if you force the use of a keyword and prevent derivation from the magic base class, then you are keeping your intent separate from the magic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 530k
  • Answers 530k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The short answer is "pull". From there, you have two… May 16, 2026 at 11:35 pm
  • Editorial Team
    Editorial Team added an answer You want the href property on the location object, like… May 16, 2026 at 11:35 pm
  • Editorial Team
    Editorial Team added an answer Hmmm, I'm getting output: In[8]:= WeatherData["Chicago","Conditions",{2010,8, 1}, "Value"] Out[8]= {{},{},{},{},{},{},{Fog},{Fog},{Fog},{Fog},{Fog},{Fog},{},… May 16, 2026 at 11:35 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

In the MSDN documentation, System.Reflection.Assembly has a property called CodeBase which is defined as
In http://msdn.microsoft.com/en-us/library/system.security.cryptography.pkcs(VS.85).aspx we can see that the following digital signature attributes are defined: Pkcs9ContentType
From http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute(VS.71).aspx: [C++] [StructLayout(LayoutKind::Explicit, Size=16, CharSet=CharSet::Ansi)] __value class MySystemTime { public: [FieldOffset(0)] short int
I have some misunderstanding about the gslice function. Definition from MSDN states: gslice defines
According to the MSDN documentation for the WindowStartupLocation Property : Setting CenterScreen causes a
Reading from MSDN: A delegate is a type that references a method. Once a
MSDN describes UnhandledExceptionFilter as follows: An application-defined function that passes unhandled exceptions to the
As per this MSDN link, There is no way to replace only part of
I write the following code for some test, and the output is out of
In an assembly loaded into the current AppDomain using Assembly.LoadFrom , I have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.