私はJavaのエキスパートではないので、私はJavaの小さなアプリケーションを作成しました。私のプログラムはそれほど効率的ではありません。 いくつかの経験のある人は、私の次の質問にお答えします場合、私は感謝するでしょう:より高速であるどんなプログラミング方法がより速いのですか?
どちら:
Question1
boolean b1;
b1=true;
または
boolean b1= true;
質問2
boolean b1;
boolean b2;
又は
boolean b1, b2;
Question3
for (int index goes to some iterations)
{
MyCustomClass obj = new MyCustomClass();
//Some other code goes here
}
又は
MyCustomClass obj = new MyCustomClass();
for (int index goes to some iterations)
{
obj.Reset();// Assume .Reset() have same codes as zero argument constructor has
//Some other code goes here
}
事前に感謝
あなたはそれを試してみてはどうでしょうか? – skaffman
試しましたか?宿題のように見える? –
"私たちは小さな効率を忘れるべきです、時間の約97%を言いましょう:時期尚早最適化はすべての悪の根源です" - Knuth – Dave