exception in thread "main" java.lang.NoclassDefFoundError: cal/class
Posted
by Gaurav
on Stack Overflow
See other posts from Stack Overflow
or by Gaurav
Published on 2010-06-13T21:35:48Z
Indexed on
2010/06/13
21:42 UTC
Read the original article
Hit count: 288
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.");
}
}
}
© Stack Overflow or respective owner