public class Arrys {
private int[] nums;
//Step 3
public Arrys (int arrySize) {
nums = new int[arrySize];
}
public int [] getNums(){
return nums;
}
}
測試類:這個java輸出是什麼意思?
public class TestArrys
{
public static void main(String args[])
{
//Step 4
Arrys arry = new Arrys(10);
System.out.println("\nStep4 ");
for(int index = 0; index < arry.getNums().length; index++) {
System.out.print(arry.getNums());
}
}
}
這是令人難以置信的簡單,這就是爲什麼我覺得我做的事情基本上是錯誤的。我只想顯示數組的值。
這就是我回來的。我完全失去了,我的書裏沒有任何東西可以解釋這一點,也沒有用Google搜索它的幫助。
Step4 [[email protected][[email protected][[email protected][[email protected][[email protected][[email protected][[email protected][[email protected][[email protected][[email protected][[email protected]
你說得很對。我瞥了一眼這個問題,看到了'[l @ 1ac88440',並認爲我知道這個問題是關於什麼的 - 但我錯了。 – 2010-03-09 17:40:28
@mmyers:據我所見,你根本沒有錯...... – 2010-03-09 17:42:35
也許我需要喝咖啡。 – 2010-03-09 17:44:03