+ 1

More types

how can I enter the choice in char?... it's not working when I did it... https://code.sololearn.com/c1tNXRybs4or/?ref=app

21st Sep 2018, 3:40 PM
mn121
mn121 - avatar
1 Answer
0
Accept input as String, then grab the first character off the String as a char. String s = in.readLine(); char op = s.charAt(0); switch(op) { case '+': // code here break; case '*': // code here break; // more cases here } Hth, cmiiw
22nd Sep 2018, 1:49 AM
Ipang
OSZAR »