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
How to use the processing core library to create a PIMAGE in Java Netbeans?
Advanced Facebook Fan Page Formatting
get wrong autodiscover server in warning message....
Cisco ASA 5505 Remote Access VPN Problem
OCS 2007 R2
C# WMI query for getting current logged on user doesn't work on Windows 7
Problems moving L2L IPSec VPN from Cisco PIX to Cisco ASA 5520, connecting from Cisco 877
Looking for Video Recording Software for Samsung Cameras
RWW Screen Resolution
'System.Xml.Linq' doesn't contain any public member