Is ++x more efficient than x++ in Java?
问题 During a programming class, the professor was teaching us about x++ and ++x , with x being an integer. He said that in the scenario we are able to just put either x++ or ++x , ++x is more efficient (by little, but still, in theory, more efficient nonetheless). But I forgot why . Anyone knows? This was with Java. 回答1: It's not more efficient in Java. It can be more efficient in languages where the increment/decrement operators can be overloaded, but otherwise the performance is exactly the