Answers for "java get class from type"

1

java get class name of object

myObject.getClass().getName()
Posted by: Guest on December-26-2020
0

how to use getclass in java

public static String printClassInformation(Object o){
	Class<?> cl=o.getClass();
  	System.out.println("Name: "+cl.getSimpleName());
  	System.out.println("Full name: "+cl.getCanonicalName());
  	System.out.println("Methods: "+Arrays.toString(cl.getMethods()));
}
Posted by: Guest on April-06-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language