How to find Class of Object

 public class Main 
 {
   public static void main(String args[])
   {
      A objA = new A();
  
      if(objA instanceof A)
      {
	System.out.println(objA.getClass());
      }
   }
}

class A
{	
}

Leave a reply