美文网首页
002 unresolved compilation probl

002 unresolved compilation probl

作者: 曾经过的雨 | 来源:发表于2018-03-08 11:51 被阅读0次
  • cannot be resolved
int price;
//Scanner in = new Scanner(System.in);
price = in.nextInt();
System.ou.println("100-" + price + "=" + (100-price));  
  • reson:

You must difine it before using it.

  • principle:

Scanner是一个类,一个开源代码,为了获取控制台输入。用它创建一个对象(in),System.in可以看做一个参数(系统输入流),这个参数是键盘输入内容,可以用in.nextLine()方法等待用户输入,如果用String XX来接收就是:String XX=in.nextLine()。

相关文章

网友评论

      本文标题:002 unresolved compilation probl

      本文链接:https://www.haomeiwen.com/subject/epzefftx.html