|
What is the wrapper class for the primitive numeric type int? A good answer might be:Integer |
Integer Input(It would not be too surprising if you forgot that.) Here is a program that computes the square of a number that the user enters. It uses the one-line method of constructing a BufferedReader.
This program is the previous program with a few additions (in blue). You can copy-paste-and-run it. Better yet, study it for a while, then go to NotePad and see how much you can reconstruct. Now look at this statement:
This uses the method parseInt() of the Integer wrapper class. This method takes a String containing an integer in character form. It looks at those characters and calculates an int value. That value is assigned to num. |
QUESTION 15:What would the following statement do?
Click Here after you have answered the question
|