Hi friends,
please let me know why I am not able to run this following program. This is program is there in complete reference book (packages);
package MyPack;
class Balance
{
String name;
double bal;
Balance(String n,double b)
{
name=n;
bal=b;
}
void show()
{
if(bal<0)
{
System.out.println("-->");
System.out.println(name+": $"+bal);
}
}
}
class AccountBalance
{
public static void main(String args[])
{
Balance current[]=new Balance[3];
current[0]=new Balance("K.J.Fielding",123.123);
current[1]=new Balance("Will Tell",157.02);
current[2]=new Balance("Tom Jackson",-12.33);
for(int i=0;i<3;i++)
current[i].show();
}
}
I am gettting the following exceptions
1. A
java excpetion has occured
2.Could not find the main class,a JNI error has occured, please check installation and try again.
But I m able to run other programs on the same eclipse.
Thanks.