構造函數處提示
This method has a constructor name
這個方法(函數)具有構造函數名稱(實際上已不是構造函數)
調用構造函數時提示
The constructor StuGroup(int) is undefined
這個構造函數沒有被定義
這個錯誤是什么原因呢?
我們來看構造函數
public void StuGroup(int len) { stu = new Student[len]; }
不容易看出來的是,構造函數不能有返回值,即便是空也不行
須將返回類型去掉