THIS IS THE CODE here I want to take value from cmd and use that to get the output. Please let me know if there is any other problem. Thanks
class Basic
{
int b;
public void gd(int c){
b=c;
}
}
class HRA extends Basic
{
double hra=(0.25*b);
}
class DA extends HRA
{
double da=(0.75*b);
}
class PF extends DA
{
double pf=(0.12*b);
}
class Netsalary extends PF
{
double ns=b+hra+da+pf;
void display()
{
System.out.println("The net salary = "+ns);
}
}
class Netsalmain
{
public static void main(String arb[])
{
int a= Integer.parseInt(arb[0]);
Netsalary ob=new Netsalary();
ob.gd(a);
ob.display();
}
}
error is showing like this
E:>java Netsalmain Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at Netsalmain.main(iop.java:54)