Re: [問題] 樂透的程式

看板java作者 (雙生兒)時間18年前 (2006/02/24 09:48), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串7/9 (看更多)
※ 引述《tenue (天雨)》之銘言: : 恕刪 : 以下程式碼: : public class Lotter{ : private int ball=0; : public void setball(int b){ : ball=b; : } : public void roll(){ : double di=49*Math.random()+1; : double num1=Math.floor(di); : setball((int)num1); : ^^^^^^^^^^^^^^^^^^^^^^^ } 請問這一行是代表什麼意思呢??屬於屬性 還是方法? : public static void main(String[] args){ : Lotter l=new Lotter(); : l.roll(); : System.out.println(l.ball); : } : } : -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.70.99.49
文章代碼(AID): #13_cOBjQ (java)
討論串 (同標題文章)
文章代碼(AID): #13_cOBjQ (java)