您好,我只是盯着 java,我一直在到处寻找如何制作基于 Scanner 的 UI,它将在单独的窗口上打印以下解析方法:
Character [A] located at position 0 is a vowel
Character [b] located at position 1 is a consonant
Character [r] located at position 2 is a consonant
Character [a] located at position 3 is a vowel
Character [h] located at position 4 is a consonant
...
16 [Abraham Lincoln ]
14 [braham Lincoln]
12 [raham Lincol]
10 [aham Linco]
8 [ham Linc]
6 [am Lin]
4 [m Li]
2 [ L]
0 []
我有执行此操作的方法的代码,但现在我所拥有的只是一个扫描仪,它将我在 Eclipse 控制台上键入的任何输入转换为一个字符串,然后进行解析。
String enterName;
Scanner name = new Scanner(System.in);
System.out.println("Enter your name");
enterName = name.nextLine();
非常感谢任何帮助,谢谢。