Re: [問題] JAVA的call by value

看板java作者 (骨頭)時間19年前 (2007/03/24 22:48), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串6/7 (看更多)
※ 引述《drinks (不告訴你..)》之銘言: : ※ 引述《ldg (ldg)》之銘言: : : class student{ : : static void print(){ : : ... : : } : : student.print(); : : } : : } : 小弟我剛學java不久 ,說錯請見諒喔.. : 請高手指教了. : 第一行應該要加 public, 同物件內引用 加不加都無所謂 要看他有沒有要發布給外部class決定要不要加public : student.print(); 這行的意思是? : 如果要使用print(),應該是用s[] 來呼叫才是 : 你的程式碼 並沒有叫做student的實體. print是static方法 由類別所擁有 而非instance所擁有 (你指的物件實體) -- 建議你先看完修飾字的章節,這部份的概念很基本。 -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the compiler will stack.push(scouting.buck()); | answer your life stack.push(bowling.practice()); | Bone everything -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.27.68
文章代碼(AID): #161JeoK8 (java)
討論串 (同標題文章)
文章代碼(AID): #161JeoK8 (java)