我的那个out后面点写错了么.老运行失败,提示我的点有问题

来源:3-6 编程练习

mminee

2019-09-08 13:52:37


public class VarDemo {     public static void main(String[] args) {        //定义一个整型变量n,值是5        int n=5;        //将n的值输出        System.out.printIn(n);        //让n的值变为10        n=10;        //将n的值输出        System.out.printIn(n);      } }

写回答

2回答

好帮手慕酷酷

2019-09-08

同学你好,代码的思路很棒!但是有一个小问题,输出语句中,应该是System.out.println(n);,小写的l,而不是I。具体如下:

http://img.mukewang.com/climg/5d74b11e0001108f04420264.jpg

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

1

mminee

提问者

2019-09-08

public class VarDemo {
public static void main(String[] args) {
//定义一个整型变量n,值是5
int n=5;
//将n的值输出
System.out.printIn(n);
//让n的值变为10
n=10;
//将n的值输出
System.out.printIn(n);

}
}

0
hminee
h VarDemo.java:6: error: cannot find symbol System.out.printIn(n); ^ symbol: method printIn(int) location: variable out of type PrintStream VarDemo.java:10: error: cannot find symbol System.out.printIn(n); ^ symbol: method printIn(int) location: variable out of type PrintStream 2 errors
h019-09-08
共1条回复

0 学习 · 393 问题

查看课程