O'Reilly logo

C# for Java Developers by Adam Freeman, Allen Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inspecting Types

Central to reflection is the abstract System.Reflection.MemberInfo class. Concrete classes are derived from MemberInfo to form representations of each member type, including constructors, methods, properties, and fields. For general information about each of the .NET member types, see Chapter 5.

Instances of classes derived from MemberInfo are obtained through the methods of the System.Type class; these methods are grouped by the member type they reflect and follow a clear pattern, each offering three forms, as shown in the following list:

  • GetXXX(System.Type[])

  • GetXXXs(System.Reflection.BindingFlags)

  • GetXXXs()

The XXX indicates a member type—for example, GetConstructor(Type[]), GetConstructors(BindingFlags), and GetConstructors()

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required