I get the above error when I try to compile this simple program:
/* @author
* This program expects two command-line arguments
* -- a person's first name and last name.
* For example:
* C:\Mywork> java Greetin Annabel Lee
*/
public class Greetin
{
public static void main(String[] args)
{
String firstName = args[0];
String lastName = args[1];
System.out.println("Hello, " + firstName + " " + lastName);
System.out.println("Congratulations on your second program!");
}
}
From looking at other questions, I understand the error has something to do with args == 0 and 0 being greater than the number, but I don't know how to fix the problem for this case.
Is there any way the error is also identified as being caused by the void?
java Greetin Annabel Leeas you have in your comment?