Hi. My problem is smiling. Ive got 2 file *.class
1st file
2nd fileCode:import java.io.IOException;
public class Vyber {
public static int x;
public static void vyber() throws IOException {
volba.vyberSi(x);
System.out.println(x+" vyber");
switch(x){
case 1: radkove_orientovany_IO.zapisDoSouboru();
case 2: bajtProud.bP();
case 3: znakProud.zP();
case 4: scanner.sc();
case 5: desCarka.dC();
}
}
}
I dont know how transmit int x. In class volba is x allright, but in class Vyber int x isnt the same number.Code:import java.util.*;
public class volba {
public static int vyberSi(int x){
Scanner sc = new Scanner(System.in);
x = sc.nextInt();
System.out.println(x+ " volba");
return x;
}
}
Thanks for any response.
