CAN 问答列表

java.util.NoSuchElementException - 扫描程序读取用户输入

作者:fortune 提问时间:10/24/2012

我是使用 Java 的新手,但我以前有一些使用 C# 的经验。我遇到的问题是从控制台读取用户输入。 我在使用这部分代码时遇到“java.util.NoSuchElementException”错误:...

如何在 Java 中的 System.in 上使用多个 Scanner 对象?

作者:ghostdog74 提问时间:11/20/2010

在我的程序中使用多个 Scanner 对象的正确方法是什么? 例如,我使用扫描仪读取文件,然后根据文件中的内容,提示用户输入并再次使用扫描仪。 以下是我的代码摘录: Scanner f = ne...

扫描程序在使用 next() 或 nextFoo() 后跳过 nextLine()?

作者:blekione 提问时间:10/28/2012

我正在使用这些方法并阅读输入。ScannernextInt()nextLine() 它看起来像这样: System.out.println("Enter numerical value"); i...

扫描仪在使用 next() 或 nextFoo() 后跳过了 nextLine()?

作者:blekione 提问时间:10/28/2012

我正在使用这些方法并读取输入。ScannernextInt()nextLine() 它看起来像这样: System.out.println("Enter numerical value"); i...

扫描仪在使用 next() 或 nextFoo() 后跳过了 nextLine()?

作者:blekione 提问时间:10/28/2012

我正在使用这些方法并读取输入。ScannernextInt()nextLine() 它看起来像这样: System.out.println("Enter numerical value"); i...

如何从我输入的时间中减去分钟数?

作者: 提问时间:9/29/2021

我正在做教授的作业,要求我写一个班级,以小时和分钟表示时间。我必须能够在时间上添加小时,从时间中减去小时,在时间上添加分钟,从时间中减去分钟。我坚持在时间上增加分钟。如果时间是 11:00,我想增加 ...

扫描仪在使用 next() 或 nextFoo() 后跳过了 nextLine()?

作者:blekione 提问时间:10/28/2012

我正在使用这些方法并读取输入。ScannernextInt()nextLine() 它看起来像这样: System.out.println("Enter numerical value"); i...

扫描仪在使用 next() 或 nextFoo() 后跳过了 nextLine()?

作者:blekione 提问时间:10/28/2012

我正在使用这些方法并读取输入。ScannernextInt()nextLine() 它看起来像这样: System.out.println("Enter numerical value"); i...

扫描仪在使用 next() 或 nextFoo() 后跳过了 nextLine()?

作者:blekione 提问时间:10/28/2012

我正在使用这些方法并读取输入。ScannernextInt()nextLine() 它看起来像这样: System.out.println("Enter numerical value"); i...

扫描仪在使用 next() 或 nextFoo() 后跳过 nextLine()?

作者:blekione 提问时间:10/28/2012

我正在使用这些方法并读取输入。ScannernextInt()nextLine() 它看起来像这样: System.out.println("Enter numerical value"); i...


共565条 当前第8页