PART I
C h a p t e r 1 7 :
R u n t i m e T y p e I D , R e f l e c t i o n , a n d A t t r i b u t e s
467
PART IPART I
Console.WriteLine(")");
Console.WriteLine();
}
}
}
The output is shown here:
Analyzing methods in MyClass
Methods supported:
Int32 Sum()
Boolean IsBetween(Int32 i)
Void Set(Int32 a, Int32 b)
Void Set(Double a, Double b)
Void Show()
Type GetType()
String ToString()
Boolean Equals(Object obj)
Int32 GetHashCode()
Notice that in addition to the methods defined by
MyClass
, the methods defined by
object
are also displayed. This is because all types in C# inherit
object
. Also notice that the .NET
structure names are used for the type names. Observe that
Set( )
is displayed twice. This
is because
Set( )
is overloaded. One version takes
Do'stlaringiz bilan baham: |