Thread currentThread = Thread.currentThread();
String threadName = currentThread.getName();
System.out.println("当前线程的名称为:" + threadName);
Thread currentThread = Thread.currentThread();
currentThread.setName("MyThread");
System.out.println("当前线程的名称为:" + currentThread.getName());
Class<?> clazz = String.class;
String className = clazz.getName();
System.out.println("String类的全限定名称为:" + className);
Object obj = new String("Hello");
String className = obj.getClass().getName();
System.out.println("对象的类名为:" + className);
Method method = String.class.getMethod("toUpperCase");
String methodName = method.getName();
System.out.println("方法的名称为:" + methodName);