using extension methods on int

后端 未结 7 1321
难免孤独
难免孤独 2021-02-19 04:10

I\'m reading about extension methods, and monkeying around with them to see how they work, and I tried this:

namespace clunk {
    public static class oog {
             


        
7条回答
  •  花落未央
    2021-02-19 04:42

    In the first instance you are writing an extension method - e.g. extending the functionality of the int data type. In the second code set, you are trying to override the bool operators. These are two totally different things.

提交回复
热议问题