Customer.class
and cust.getClass()
work, but ? What is the difference?cust.class
does not
public class Customer() {
}
public class Test {
public Test() {
Customer cust = new Customer();
test(Customer.class);
test(cust.getClass());
}
public <T> void test(Class<T> clazz) {
System.out.println(clazz);
}
}