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
VC++ change .exe icon
Server problems
How to Combine The Data in Two Excel Sheet into One Using VBA
Virus and/or Malware redirecting my links
Windows 7 best practices for VMware view
Missing Text Description in Add/Remove Programs
Inventory System (Freeware) Recommendation
Backup Exec will not connect server after move
PHP_sessions
Checklist for Windows 2003 AD upgrade to Window 2008 AD