Hi! I'm executing the code from Eclipse(thus saying that there is no problem and can find the other class), executing the code from the terminal gives me "cannot find symbol" error saying that it cannot find the other class called "Metodi".
Here's the codes:
package provaJava;
public class Programma {
public static void main(String[] args) {
String espressione = args[0];
String valori = args[1];
if(!(Metodi.checkEspr(espressione))) {
System.out.println("Espressione non corretta!");
System.exit(1);
}
}
}
package provaJava;
public class Metodi {
static char[] valoriCorretti = new char[] {'A','B','C','D','E'};
public static boolean checkEspr(String stringa) {
boolean flag1 = false;
boolean flag2 = false;
boolean flag3 = false;
if(stringa.length() < 5) {
return false;
}
if(stringa.charAt(1) == '+' || stringa.charAt(3) == '-') {
for(int i = 0; i < valoriCorretti.length; i++) {
if(stringa.charAt(0) == valoriCorretti[i] || stringa.charAt(0) < 9) {
flag1 = true;
}
if(stringa.charAt(1) == valoriCorretti[i] || stringa.charAt(1) < 9) {
flag2 = true;
}
if(stringa.charAt(3) == valoriCorretti[i] || stringa.charAt(3) < 9) {
flag3 = true;
}
}
}
return (flag1 && flag2 && flag3);
}
}
And there is a dump of the error: