exception in thread "main" java.lang.NoclassDefFoundError: cal/class
- by Gaurav
enter import java.io.*;
class eval
{
double add(double a,double b)
{
return (a+b);
}
double sub(double a,double b)
{
return (a-b);
}
double mul(double a,double b)
{
return (a*b);
}
double div(double a,double b)
{
return (a/b);
}
}
class cal extends eval
{
public static void main(String args[])throws IOException
{
eval a1=new eval();
try{
System.out.println("1) Add");
System.out.println("2) Subtract");
System.out.println("3) Multiply");
System.out.println("4) Divide");
System.out.println("5) Enter your choice");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int ch;ch=Integer.parseInt(br.readLine());
System.out.println("Enter two number");
double a;a=Integer.parseInt(br.readLine());
double b;b=Integer.parseInt(br.readLine());
switch(ch)
{
case 1:
a1.add(a,b);
break;
case 2:
a1.sub(a,b);
break;
case 3:
a1.mul(a,b);
break;
case 4:
a1.div(a,b);
break;
}
}
catch (IOException e)
{
System.out.println("Error occured, please restart application.");
}
}
}