Java run error - ArrayIndexOutOfBoundsException
Hi, I try to run code below but it show me the error :
public class JClientDemo {
public static void main (String [] args)
{
JClientDemo demo = new JClientDemo ();
demo.testClientApi (args);
}
public void testClientApi (String [] args)
{
System.out.println("Test Client API starts");
if (args[0] != null)loginRequest.setServerIp(args[0]);
if (args[1] != null) loginRequest.setServerPort (Integer.parseInt(args[1]));
if (args[2] != null)loginRequest.setLoginFile(args[2]);
System.out.println("Test Client API Finish");
}
}
Output :
Test Client API starts
java.lang.ArrayIndexOutOfBoundsException: 0
at JClientDemo.testClientApi(JClientDemo.java:53)
at JClientDemo.main(JClientDemo.java:20)
Exception in thread "main"
Any problem with this program ? Thanks.

