噢,明白是怎么一回事了!多谢各位!! 最后再请教一下各位,如果我想用corejava类中的Console方法,还需要有什么设置吗? 比如以下的程序: import corejava.*; public class StringPrompt { public static void main(String args[]) { String yourName; yourName=Console.readString("please enter your name"); System.out.println("Hello"+yourName); } } 编译时会有如下的提示:package corejava does not exist import corejava.*; StringPrompt.java:7:cannot resolve symbol symbol:variable Console location:class StringPrompt yourName=Console.readString("please enter your name");2errors
value是什么
PassTest中没有pt.changeInt(int val) 这个方法improt可以不用的
請自己輸入一邊
裡面有很多的全角空白,把他去掉吧
value=10; ->ptValue=10;
pt.changeInt(val); -> pt.changeObjValue(pt);
or
add
public void changeInt(int val){
ptValue=val;
}
public void changInt(int val)
{val=55;
}
public void changValue(PassTest ref)
{ref.ptValue=99f;
这两个方法的不能这样子写呀,这个程序的目的是我想试一下整型参数和对象参数到低有什么不一样!或者是: {int val=11;
PassTest pt=new PassTest();
System.out.println("wq:"+val);
pt.changeInt(val);
System.out.println("aften:"+val);
pt.Value=101f;
System.out.println("befor:"+pt.Value);
pt.changValue(pt);
System.out.println("after:"+pt.Value);
中的val=11和pt.Value=101f;不能这样子直接赋值,或者是System.out.println?("aften:"+val);这不能这样子写
最后再请教一下各位,如果我想用corejava类中的Console方法,还需要有什么设置吗?
比如以下的程序:
import corejava.*;
public class StringPrompt
{
public static void main(String args[])
{
String yourName;
yourName=Console.readString("please enter your name");
System.out.println("Hello"+yourName);
}
}
编译时会有如下的提示:package corejava does not exist
import corejava.*;
StringPrompt.java:7:cannot resolve symbol
symbol:variable Console
location:class StringPrompt
yourName=Console.readString("please enter your name");2errors
呵呵!不好意思啊!上面的是程序,下面的是我编译时的错误提示!
我觉得他提示好像是说的corejava包不存在?如果我想要用到这个包的话我该怎么办呀?真的不好意思!学JAVA半个月了,学到这种程度真的不好意思见人了!