找不到扫描仪 [英] Cannot find the scanner

查看:59
本文介绍了找不到扫描仪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我正在使用GUIJOptionPane,因此对scanner的经历非常糟糕.因此,我无法执行程序的scanner实习生,因为.我是新手,所以请帮助我找不到scanner".到目前为止,这是我的代码.

I have a very bad experienced about the scanner because I am using GUI and JOptionPane. So I am not be able to do the program's interns of scanner because. I am new to it so Please help me, "cannot find the scanner". This is my code so far .

import java.io.*;
import java.util.*;

class MultiplicationTables{
     public static void main(String args[]){
          int n, c;
          System.out.println("Enter an integer to print its multiplication table");
          Scanner in = new Scanner(System.in);
          n = in.nextInt();
          System.out.println("Multiplication table of "+n+" is :-");

          for ( c = 1 ; c <= 10 ; c++ )
             System.out.println(n+"*"+c+" = "+(n*c));
     }
}

推荐答案

首次导入是多余的.

import java.io.*; // you can remove it

Scanner是java.util软件包中的类. 检查天气,您是否已在IDE或系统中正确设置了jdk路径. 取决于您使用的系统: Windows:高级系统设置->环境变量->路径检查是否有通往jdk的路径.

Scanner is a class in java.util package. Check weather you have properly set your jdk path in your ide, or in your system. Depends on system that you use: Windows: Advanced System Settings->Environment Variables->Path check weather there is your path to jdk.

在控制台中的UNIX上打印'echo $ PATCH',并检查是否正确添加了jdk路径.

UNIX in console print 'echo $PATCH' and check that if you have there jdk path properly added.

然后您可以在控制台编写中检查系统独立于系统的Java版本

And then you can check your version of java independent to system in console writing

java --version

这篇关于找不到扫描仪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆