I++ vs i=i+1 in Java

Often, i++ and i=i+1 are considered to be same statements but in Java, both statements work differently internally. We will take a look at:

  • The compiler instructions used
  • Typecasting along with the operations
  • benchmarking the two operations


Read this article to understand i++ vs i=i+1 in Java in depth

Have a doubt or thought? Join the discussion now
This is a companion discussion topic for the original entry at http://iq.opengenus.org/i-vs-ii1-java/