package myJava; public class ggg // { public static void main(String args[]) { CMyClass X[] = new CMyClass[5]; for(int i=0;i<X.length;i++) X[i] = new CMyClass(); COtherClass Obj = new COtherClass(); Obj.show(X); } }
class COtherClass { public void show(CMyClass X[]) { for(int i=0;i<X.length;i++) System.out.println("物件X[" + i + "]實體的位址在" + X[i]); //這行加 入 System.out.println(" VarA =" +VarA);有錯誤訊息1如下
} }
class CMyClass { public int VarA; //這行加入System.out.println(" VarA=" + VarA);錯誤訊息2
private int VarB; }
////////////////////////////////////////////// 錯誤訊息1 error;cannot find symbol System.out.println("Var A="+VarA); symbol: variable VarA location: class COtherClass 1 error
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html
You are receiving this email because you subscribed to this feed at blogtrottr.com.
留言列表