|
How have our Java programs been reading numerical data? A good answer might be:The user has entered characters from the keyboard which are then transformed into primitive numeric types. | |
Numeric InputThe same method is used for numeric input using a redirected input file. The program is written to do numeric input from the keyboard, then connected to a data file by redirection. Here is a program that adds up two integers entered from the keyboard:
C:\users\default\JavaLessons>java AddTwo Enter first number: 12 Enter second number: 7 Sum: 19 C:\users\default\JavaLessons> | |
QUESTION 8:Why are there parentheses around "(numberA + numberB)" ? Click Here after you have answered the question |