かなり初心者です。全然意味がわかりません。教えてください。よろしくおねがいします。 この意味すべてわからないです。 public class TestCount{ static int counterA; int counterB; public static void main(String []args){ TestCount testA=new TestCount(); TestCount testB=new TestCount(); testA.count(); testB.count(); } public void count(){ for(int i=0;i<5;i++){ counterA++; counterB++; } System.out.println("counterA="+counterA); System.out.println("counterB="+counterB); } } 実行結果 counterA=5 counterA=5 counterB=10 counterB=5 なんでこうなるのかが知りたいです。
↧