1. ERROR : a,b,c are not defined
You should set
int a,b,c
in global
2.Assign value of the parameter
a,b,c,d
to variable
a,b,c,d
which you have set in the global
public Sub(int a, int b, int c, int d) {
this.a=a;
this.b=b;
this.c=c;
this.d=d;
}
3. Modify your ocde as below.
int
cannot print
String result
switch (k)
{
case 1:
double c22 = w + x + y + z;
if (w == 1 && x == 5 && y == 4 && z == 1) {
System.out.println("result for 1st");
}
else if(w == 1 && x == a && y == b && z == 1)
{
System.out.println("result for 2nd");
}
else if(w == c && x == a && y == b && z == 1)
{
System.out.println("result for 3nd");
System.out.println("result for 4th");
}
else
{
System.out.println("no matched");
}
System.out.println("addition of two no. is : " + c22);
break;
.....
}