Почему это терпит неудачу с ошибкой: < /p>
Args are: -normi -nosplash
Exception in thread "main" java.lang.IllegalArgumentException: wrong
number of arguments
at sun.reflect.NativeConstructorAccessorImpl
.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl
.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl
.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at TSStack.main(TSStack.java:14)
< /code>
Вот код: < /p>
public static void main(String args[]) throws Exception {
System.out.println("Args are: " + args[0]+ " " + args[1] );
try {
Constructor c = Site.class.getDeclaredConstructor();
c.setAccessible(true); // use reflection to get access to
//this private constructor
c.newInstance( (Object[])args );
} catch (InvocationTargetException x) {
x.printStackTrace();
} catch (NoSuchMethodException x) {
x.printStackTrace();
} catch (InstantiationException x) {
x.printStackTrace();
} catch (IllegalAccessException x) {
x.printStackTrace();
}
}
Подробнее здесь: https://stackoverflow.com/questions/680 ... args-error