Chapter 12. Reflection

Reflection exposes type information at run time, supporting powerful scripting technologies and applications that allow plug-in modules, such as application servers. This chapter details the .NET support for reflection, demonstrating how to gain type information and programmatically instantiate and manipulate types.

Dealing with Types

Java and .NET both encapsulate the details of a type in a single class: Java relies on java.lang.Class, and .NET defines System.Type. The following sections describe how to obtain System.Type instances.

Local Types

Local types are those that are directly available within the scope of an application. In Java, local types are those that can be found in the classpath; in .NET, local types are those ...

Get C# for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.