Calculator.java:26: incompatible types found : java.lang.String required: int switch (size) { ^ 1 error Finished! Press any key to continue . . .
that's my error. i understand it but i don't know what int i should put there.
heres my code
public static void main(String[] args) { System.out.print("Enter your equation size and press Enter: "); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String size = null; try { size = br.readLine(); } catch (IOException e) { System.out.println("Error!"); System.exit(1); } switch (size) { case 1: oneStep(); break; case 2: twoStep(); break; } System.out.println("Your equation size is: "+size); }