看板 java 關於我們 聯絡資訊
※ 引述《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