This shows you the differences between two versions of the page.
java:util:scanner [2013/04/08 09:30] 94.222.245.67 |
java:util:scanner [2024/02/16 01:03] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
Reads input from a Keyboard, or a Device | Reads input from a Keyboard, or a Device | ||
- | ===== example Scanner ===== | + | CODE_SIGN_IDENTITY |
+ | |||
+ | --verify | ||
+ | |||
+ | --file-list | ||
+ | |||
+ | --display -r- Terminal.app | ||
+ | |||
+ | |||
+ | |||
+ | ===== example Scanner in java ===== | ||
<code java> | <code java> | ||
package scanner; | package scanner; | ||
Line 23: | Line 33: | ||
currencyName = scan.nextLine();/* read String*/ | currencyName = scan.nextLine();/* read String*/ | ||
- | scan.nextLine(); // clear the keyboard buffer ... trow a \r\n away | + | scan.nextLine(); // clear the keyboard buffer ... trow a \n away |
System.out.print("Please enter the exchange rate (with decimal places): "); | System.out.print("Please enter the exchange rate (with decimal places): "); |