Re: [問題] 樂透的程式
    恕刪
    以下程式碼:
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: 59.114.37.61
※ 編輯: tenue           來自: 59.114.37.61         (02/23 21:27)
※ 編輯: tenue           來自: 59.114.37.61         (02/23 21:27)
討論串 (同標題文章)
java 近期熱門文章
PTT數位生活區 即時熱門文章