Monday, December 12, 2011

Get the class name of any Object in Java

Using the getClass() method of any object, you can easily obtain the name of the class of that Object. Below is a simple code snippet to clear the things.


TestClass t = new TestClass();
System.out.println(t.getClass().getName());
// output: TestClass

No comments:

Get function name programaticaly - Python

This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...