use the nextmethod ofthe Scannerclass, which returns a String.We then
extract just the first character ofthe String(via the charAtmethod ofthe
String class) to produce a char to use as our switch variable.
One more note on the calculator.We need to check whether the divisor is 0
before performing division (line 60).Although we discussed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.