does a Java getter incur a performance penalty

Posted by alan on Stack Overflow See other posts from Stack Overflow or by alan
Published on 2010-04-06T04:39:05Z Indexed on 2010/04/06 4:43 UTC
Read the original article Hit count: 232

Filed under:

if i have the code

int getA(){ return a; }

and then do something like

int b = obj.a();

instead of

int b = obj.a;

will that mean that the stack will have to be pushed and popped ultimately slowing down my code?

© Stack Overflow or respective owner

Related posts about java