Reputation: 30127
Can I be sure that
private int value;
public int getValue() { return value; }
is compiled by compiler in the same way as
public int Value;
in the terms of number of instructions and execution time? I mean do modern compilers trying to make functions "inline" (c++ term)?
Upvotes: 0
Views: 569
Reputation: 887797
No; the Java compiler will not change that.
However, the JITter probably will.
Upvotes: 4