From the world of PHP I have decided to give C# a go. I’ve had a search but can’t seem to find the answer of how to do the...
Does creating an object using reflection rather than calling the class constructor result in any significant performance differences? 14 Answers 14
This has got me stumped. I was trying to optimize some tests for Noda Time, where we have some type initializer checking. I thought I’d find out whether a...
I’m wondering how to convert a python ‘type’ object into a string using python’s reflective capabilities. For example, I’d like to print the type of an object print "My...
Like the title says: Can reflection give you the name of the currently executing method. I’m inclined to guess not, because of the Heisenberg problem. How do you call...
Given a string of a Python class, e.g. my_package.my_module.MyClass, what is the best possible way to load it? In other words I am looking for a equivalent Class.forName() in...
$0 is the variable for the top level Ruby program, but is there one for the current method? 5 Answers 5
C#’s exception class has a source property which is set to the name of the assembly by default. Is there another way to get this exact string (without parsing...
I constantly hear how bad reflection is to use. While I generally avoid reflection and rarely find situations where it is impossible to solve my problem without it, I...
I’m a little confused about the difference between the getFields method and the getDeclaredFields method when using Java reflection. I read that getDeclaredFields gives you access to all the...