22.5. Summary

C#'s reflection lets you view and query metadata, dynamically invoke methods, set fields, and call constructors on any C# type. You can also define custom types and use reflection emit to dynamically manipulate the generated IL. Java's reflection API, in contrast, does not allow you to manipulate the generated byte code.

One noteworthy difference between the Java and C# reflection APIs is that in C#, the reflection methods that search for a particular member of a type, based on its signature, return null instead of throwing an exception. This is ideologically different from the Java world, where the nonexistence of something is usually indicated by throwing a checked exception instead of returning null. Java programmers who are used to using checked exceptions for control flow should be aware of this subtle difference in C#.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.85.33