当前位置: 技术问答>java相关
system.out.println()不好使!!!
来源: 互联网 发布时间:2015-03-03
本文导语: 我的代码: public class Fruit { public static void main(String[] args) { int numOranges=5; int numApples=10; int numFruit=0; numFruit = numOranges + numApples; system.out.println("A totally fruity program");...
我的代码:
public class Fruit
{
public static void main(String[] args)
{
int numOranges=5;
int numApples=10;
int numFruit=0;
numFruit = numOranges + numApples;
system.out.println("A totally fruity program");
system.out.println("Total fruit is " + numFruit);
}
}
为什么编译时报错:
D:JavaDocFruit.java:12: Undefined variable, class, or package name: system
system.out.println("A totally fruity program");
^
D:JavaDocFruit.java:13: Undefined variable, class, or package name: system
system.out.println("Total fruit is " + numFruit);
小弟初学JAVA,请问怎么才能调用system.out.println()???
public class Fruit
{
public static void main(String[] args)
{
int numOranges=5;
int numApples=10;
int numFruit=0;
numFruit = numOranges + numApples;
system.out.println("A totally fruity program");
system.out.println("Total fruit is " + numFruit);
}
}
为什么编译时报错:
D:JavaDocFruit.java:12: Undefined variable, class, or package name: system
system.out.println("A totally fruity program");
^
D:JavaDocFruit.java:13: Undefined variable, class, or package name: system
system.out.println("Total fruit is " + numFruit);
小弟初学JAVA,请问怎么才能调用system.out.println()???
|
System.out.println();
~
“S”大写
~
“S”大写