Java Reference
In-Depth Information
}
}
int resultYear = getResult();
if (resultYear == -1)
{
System.out.println("Could not determine when "
+ name + " was born.");
} else
{
System.out.println(name + " was born in " + resultYear);
}
}
/**
* The main method processes the command line arguments and
* then calls process method to determine the birth year.
*
* @param args Holds the Google key and the site to search.
*/
public static void main(String args[])
{
if (args.length < 2)
{
System.out.println(
"Usage:\njava WhenBorn [Google Key] [Famous Person]");
} else
{
try
{
key = args[0];
WhenBorn when = new WhenBorn();
when.process(args[1]);
} catch (Exception e)
{
e.printStackTrace();
}
}
}
}
Search WWH ::




Custom Search