Re: [問題] 樂透的程式
※ 引述《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
討論串 (同標題文章)
java 近期熱門文章
PTT數位生活區 即時熱門文章