forked from txs72/JavaTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRandomCharacter.java
More file actions
executable file
·32 lines (29 loc) · 877 Bytes
/
RandomCharacter.java
File metadata and controls
executable file
·32 lines (29 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* */ package ch07;
/* */
/* */ public class RandomCharacter
/* */ {
/* */ public static char getRandomCharacter(char ch1, char ch2) {
/* 6 */ return (char)(int)(ch1 + Math.random() * (ch2 - ch1 + 1));
/* */ }
/* */
/* */
/* */ public static char getRandomLowerCaseLetter() {
/* 11 */ return getRandomCharacter('a', 'z');
/* */ }
/* */
/* */
/* */ public static char getRandomUpperCaseLetter() {
/* 16 */ return getRandomCharacter('A', 'Z');
/* */ }
/* */
/* */
/* */ public static char getRandomDigitCharacter() {
/* 21 */ return getRandomCharacter('0', '9');
/* */ }
/* */
/* */
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch07/RandomCharacter.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/