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
asp.net-easy question
How to copy a new copy of MS Access when the mdb is open
converting mp3 to ringtones for iPhone
Oracle forms and reports in Oracle 10g
CBT for lotus notes 8.5 and sametime 8.5
802.1q trunk
What is the default for ExpiresDefault
Redistributing RIP into OSPF non-contiguous subnets.
Upgrade mixed mode Windows 2000 forest/domain to Windows 2008 R2 forest/domain
How do I decide on the hardware components required for assembling a CPU for Development purpose (Microsoft & Adobe Technologies).