i have a simple code in java but i can’t solve some errors.
errors are:
1)illegal start of expression
2)”;” expected
the errors are all found in lines *
public class Exer5 {
public static void main (String[] args) {
int num1;
int num2;
float dieresi;
int pollaplasiasmos;
int prosthesi;
int aferesi;
num1=10;
num2=6;
*public void prosthesi(int num1,int num2) {
prosthesi = num1 + num2;
System.out.println("To apotelesma tis prosthesis einai:"+prosthesi);
}
*public void aferesi() {
aferesi = num1 - num2;
System.out.println("To apotelesma tis aferesis einai:"+aferesi);
}
*public void dieresi() {
dieresi = num1 / num2;
System.out.println("To apotelesma tis dieresis einai:"+dieresi);
}
*public void pollaplasiasmos() {
pollaplasiasmos = num1 * num2;
System.out.println("To apotelesma tou pollaplasiasmou einai:"+pollaplasiasmos);
}
}
}
If that’s your original code, you are not closing the
mainfunction. You are missing a}right beforepublic void prosthesi(int num1,int num2)