JVM throw exception bcoz no element exist at index 0 in the array.So provide the parameter during running the class or just add below code so that no exception will raise :
if(args.length >= 1)
{
System.out.println(formattedDate + "> Hello, " + args[0] + "!");
}
Pass the argument as below :
java My.Hello BHARAT