package Text;
import java.lang.reflect.Constructor;
public class StaticDemo {
public static void main(String[] args) {
Constructor consrtuctor1 = String.class.getConstructor(StringBuffer.class);
String str = (String)consrtuctor1.newInstance(new StringBuffer("abc"));
System.out.println(str.charAt(2));
}
}
提示:ReflectPoint cannot be resolved to a type
at Text.StaticDemo.main(StaticDemo.java:14)
|
|