in Technology by
What is the difference between i++ and i+=1?

1 Answer

0 votes
by

Both the expressions i++ and i+=1 evaluated the same result. But the only difference is that i++ uses the increment operator (unary operator) and i+=1 uses the assignment operator.

Another difference is that the expression i++ directly increments the value of i but the expression i+=1 first converts into i=i+1 by the JVM and then executed.

Related questions

0 votes
    The main difference between application and system software is that: 1 point Application software is stored in memory ... for computer Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
0 votes
    Difference between: 1. Biotic components and Abiotic component 2. Producers and Herbivores 3. Carnivores ... proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    Answer the following questions: 1. What is data type? Give an example. 2. What is the difference between 19/6 & 19/60. ... a++ & a+ =1. Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    What is the difference between underscore and self (i.e self.xx and _xx) ?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    What is the difference between the following commands: (i) Edit Delete Contents → Delete all and Edit → Delete ... Contents → Notes Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
0 votes
    Compute divergence theorem for D = 5r^2/4 i in spherical coordinates between r = 1 and r ... proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    Uranium-238 ions accelerated through a potential difference of 2 kV and enter a uniform magnetic field of magnitude 1. ... of the ions? Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    What are the difference between Task and Thread in .NET?...
asked Feb 16, 2023 in Technology by JackTerrance
0 votes
    What's the difference between SDK and Runtime in .NET Core?...
asked Feb 16, 2023 in Technology by JackTerrance
0 votes
    What is the difference between .NET Core and Mono?...
asked Feb 16, 2023 in Technology by JackTerrance
...