14.6.1.Reading Console Input |
|
- Console.In is an instance of TextReader.
- Console.In defines two input methods: Read() and ReadLine().
|
To read a single character, use the Read() method: |
|
To read a string of characters, use the ReadLine() method: |
|
- ReadLine() reads characters until you press ENTER
- ReadLine() returns these characters in a string object.
- ReadLine() will throw an IOException on failure.
|