Are implicity/explicit conversion methods inherited in C#?

后端 未结 6 2413
春和景丽
春和景丽 2021-02-15 16:00

I\'m not sure what I\'m doing wrong here. I have a generic class, which is basically a glorified integer, with a few methods for certain string formatting, as well as into/from

6条回答
  •  广开言路
    2021-02-15 16:29

    No they're not. Here's the clue:

    public **static** implicit operator Base(int Value)

    static methods in C# are just global functions with access to private class members. They're never inherited

提交回复
热议问题