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