interface Interface1
{
public int method1();
public int method2();
}
public class Salary implements Interface1
{
public static void main(String args[])
{
int sa[]=Integer.parseInt(arg[0]);
float pf,hra,da,tax,net;
public int method1()
{
System.out.println("salary="+sa);
try{
if(sa>250000)
{
pf=sa*5/100;
hra=sa*10/100;
da=sa*8/100;
tax=sa*10/100;
net=sa+tax;
System.out.println("Net salary of an employee"+net);
}
}
catch(Exception e)
{
System.out.println("I/O error");
}
}
public int method2()
{
System.out.println("salary="+sa);
if(sa>500000)
{
pf=sa*5/100;
hra=sa*10/100;
da=sa*8/100;
tax=sa*20/100;
net=sa+tax;
System.out.println("Net salary of an employee"+net);
}
else
{
System.out.println("No deduction");
}
}
Salary s=new Salary();
s.method1();
s.method2();
}
}
I'm getting 4 errors in this program....and they are
line no.12 : illegal start of expression
line no.12 : ';' expected
line no.31 : illegal start of expression
line no.31 : ';' expected