2009-10-02から1日間の記事一覧

下限値を設定したい

こんなソースがありました。 public class Sample{ private int rate; public Sample(int rate){ this.rate = rate; if(rate < 1000){ this.rate = 1000; } } } rateが1000以下なら1000、そうじゃなければrateで初期化。 そうすることによって、this.rate >=…