Re: [問題] JAVA的call by value
※ 引述《ldg (ldg)》之銘言:
: public static void main(String[] args){
: student[] s=new student[3];
: int i;
: for(i=0;i<3;i++){
: s[i]=new student();
: s[i].number=i;
: }
: student.print();
: }
: 我希望可以印出每個student的number
: 但是不是設計instance method
: 而是希望利用一個static method
: 將整個s[]的num排版並印出來
: 在C語言的話是將s或&s傳入
: 但是在JAVA小弟不甚熟悉
: 可以幫小弟我開個頭嗎?
: 或是指導比較正確的想法
: 拜託了 謝謝
這跟 call by xxxx 一點關係也沒有吧 @___@
你要開頭,那就給你開頭
public static void printNumber(Student[] student){
}
--
侃侃長論鮮窒礙 首頁:http://www.psmonkey.idv.tw
眾目睽睽無心顫 Blog:http://ps-think.blogspot.com
煢居少聊常人事
殺頭容易告白難 歡迎參觀 Java 版(@ptt.cc)精華區 \囧/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.228.195.45
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 7 篇):