differences

differences

what is the difference between i++ and ++i?

View Answers

January 17, 2011 at 1:04 PM

hi friend,

i++ is post increment where ++i is pre-increment.

For example,

i=5;

i++;//i is 5

now i is 6

++i;//i is 7

now i is 7


January 18, 2011 at 1:21 PM

Hello Friend,

++i will increment the value of i, and then return the incremented value whereas i++ will increment the value of i, but return the pre-incremented value.

Thanks

Ads









Related Tutorials/Questions & Answers:
differences
Differences between HashMap and Hashtable?
Differences between HashMap and Hashtable?  Differences between HashMap and Hashtable
Advertisements
What are the differences between EJB and Spring
What are the differences between EJB and Spring   Hi, What are the differences between EJB and Spring Thanks
differences between require and include, include_once.
differences between require and include, include_once.  What are the differences between require and include, include_once?   Hi friends, Differebne 1: The include_once() function includes and evaluates the specified
Differences from HTML 4.01 and XHTML 1.x
Differences from HTML 4.01 and XHTML 1.x   The HTML5 has been updated with adding some advanced features, removing some hindering features and modifying some useful features in a better way. Here are the list of some
differences - Java Beginners
Private vs Public Blockchain
Private vs Public Blockchain - Similarities and differences between two types... of malicious attack). Differences between Private and Public Blockchain Now let's.... In this tutorial we have leaned the differences between Private vs Public Blockchain. You
Private vs Public Blockchain
Private vs Public Blockchain - Similarities and differences between two types... of malicious attack). Differences between Private and Public Blockchain Now let's.... In this tutorial we have leaned the differences between Private vs Public Blockchain. You
JPA Tutorials
In this section we will examine the differences and similarities between JDBC and ORM
What is difference between Hibernate 4 and 5?
Hibernate 4 and 5? Here is the differences between Hibernate 4 and Hibernate 5... and ServiceRegistry API updated. In this tutorial we have seen the differences between
What is difference between Hibernate 4 and 5?
Hibernate 4 and 5? Here is the differences between Hibernate 4 and Hibernate 5... and ServiceRegistry API updated. In this tutorial we have seen the differences between
What is difference between Hibernate 4 and 5?
Hibernate 4 and 5? Here is the differences between Hibernate 4 and Hibernate 5... and ServiceRegistry API updated. In this tutorial we have seen the differences between
JDBC vs ORM
JDBC vs ORM       In this section we will examine the differences and similarities between JDBC and ORM technologies. Both these technologies are used to save the data
J2EE Tutorial - Java Bean
J2EE Tutorial - Java Bean       To bring out the differences between the different appraoaches,  we will consider a simple case where the user types his
Difference Between ServletConfig And ServletContext
Is Window 8 better than Windows 7?
account of the differences of both the operating systems. The newly launched
Windows 8 versus Android
of the magnitude of differences at the end user experience is what going to determine... of breath from others behind. Until the recent launch of Google Nexus Q android
Java methods
Java methods  What are the differences between == and .equals
SWINGS
SWINGS  WHAT ARE THE DIFFERENCES BETWEEN AWT AND SWINGS
Docker image vs. Docker container
STRUTS
STRUTS  MAIN DIFFERENCES BETWEEN STRUTS 1 AND STRUTS 2
STRUTS
STRUTS  MAIN DIFFERENCES BETWEEN STRUTS 1 AND STRUTS 2
DROP a table and TRUNCATE
DROP a table and TRUNCATE   What are the differences between DROP a table and TRUNCATE a table
(ii) String and String Buffer Class
String and String Buffer Class  differences between : String and String Buffer Class
java
java  what is the difference between abstract and interface ?   Difference between Abstract class and Interface Differences
differce between jdk 1.5 and 1.6 with example
differce between jdk 1.5 and 1.6 with example  Hi Friends , Can u plz tell me differences between jdk1.5 and jdk 1.6 with examples
printf and println
printf and println  what is the differences between printf and println?   Hi Friend, The println prints the text on a new line, where as printf prints the text on the same line. Thanks
GET and POST methods
GET and POST methods   What are the differences between GET and POST methods in form submitting, give the case where we can use GET and we can use POST methods
Regarding Hibernate
Regarding Hibernate  Both JDBC and Hibernate are used to connect to database then whats the need of going to hibernate? What are the main differences? And could you let me know please
Difference between SCJP Exams
Difference between SCJP Exams  What is the differences between SCJP 5 (310 - 055) exam and SCJP 6 (310 - 065) exam??? Thank You In Adv
portability vs platform independent
portability vs platform independent  sir, pls tell me 1.the differences between platform independent and portability related to java technology 2.how java provides security 3.how can i prove servlet is a single instance

Ads