LoginSignup
0
0

More than 5 years have passed since last update.

【Java】ソースを書く際に…徒然覚書①

Posted at

 ▼変数の宣言は、ループの中でするべきか外でするべきかよく考える
   ⇒スコープが短い方が、機械の処理時間が短くて済む

 ▼同じ事を言ってしまっている箇所に注意
   int i = a + b;
   int sum += i;

           ⇒ int sum += a+b;

               同じ事を言ってる箇所はまとめよう!

 ▼配列にするべきか否かをよく考える
   ⇒ 後から「○番目」等と指定して取り出す必要がある場合のみ

 ▼繰り返し処理に使われているものは変数にする

 ▼
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0