All Questions
2 questions
276
votes
14
answers
125k
views
Should we avoid object creation in Java?
I was told by a colleague that in Java object creation is the most expensive operation you could perform. So I can only conclude to create as few objects as possible.
This seems somewhat to defeat ...
0
votes
1
answer
267
views
Which is better in terms of performance (bool01==bool02) vs (bool01 && bool02) [duplicate]
Which of these two is the better way of doing the same thing -
public void someMethod(String s, boolean bool02){
boolean bool01 = s!=null;
if(bool01==bool02){
doSomething();
}
}
OR
public void ...