Microsoft
Software
Hardware
Network
Question : Set Java Class toString name?
Hello,
1: 2:
Class testClass = Test.class; System.out.println(testClass);
How can I change what is printed out in the second line of this code? With an object, I would just override the toString() method. But how can it be done with a class?
Thanks,
Rich
Answer : Set Java Class toString name?
you can call it toString() if you like, eg.
public static String toString(Class clazz) {
return clazz.getName();
}
System.out.println(MyUtili
ty.toStrin
g(testClas
s));
Random Solutions
Gmail keeps hiding "all messages" label in the menu
How many types of pages r there in SQL Server?
two things with CSS menu
Upgrade Sqlite in RHEL5.4
Calender applications.....
Digital signature control not visible
iphone saying can't connect to server on Exchange 2010 account...
Stolen Laptop Remote Desktop
Motherboard driver CD for HCL - P5GD2-TVM/GB/SI
OpenOffice 3.2 GPO Install Problem