Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


T.Mani Prakash
differences
2 Answer(s)      3 years and 11 months ago
Posted in : Java Interview Questions


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


Advertisement
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



Related Tutorials/Questions & Answers:
Differences between HashMap and Hashtable?
Differences between HashMap and Hashtable?  Differences between HashMap and Hashtable
Advertisements
Differences between OLAPDataGrid and AdvancedDataGrid
Differences between OLAPDataGrid and AdvancedDataGrid: There are several differences which are following. 1. OLAPDataGrid control does not have a column dragging. 2. OLAPDataGrid control cell has a data which is a result of OLAPQuery
Differences between session and cookie
Differences between session and cookie  What are the differences between session and cookie?   Session is stored in server but cookie stored in client. Session should work regardless of the settings on the client
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 - Java Beginners
differences  What are the differences between structured programming and object oriented programming?  Hi Friend, Difference between Structured Programming and Object Oriented Programming: 1) In structured
What are the differences between require and include, include_once?
What are the differences between require and include, include_once?  What are the differences between require and include, include_once
differences between cell spacing and cell padding
differences between cell spacing and cell padding  What are the differences between cell spacing and cell padding
differences between GET and POST methods in form submit
differences between GET and POST methods in form submit  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
How to print differences of two text files
How to print differences of two text files  I have the code to compare 2 different text files, however How can I put the difference of 2 text files in other file or print the difrference in the console?? 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
For printing out strings, there are echo, print and printf. Explain the differences.
For printing out strings, there are echo, print and printf. Explain the differences.  For printing out strings, there are echo, print and printf. Explain the differences
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
What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?  What are the differences between mysqlfetcharray(), mysqlfetchobject(), mysqlfetchrow
Differences between the String, StringBuilder, and StringBuffer classes
Differences between the String, StringBuilder, and StringBuffer classes StringBuffer versus String Java provides the StringBuffer and String classes, and the String class is used to manipulate character strings that cannot
Interface Vs Abstract Class
Interface Vs Abstract Class       There are three main differences between an interface and an abstract class: At the same time multiple interfaces can be implemented, but only
JPA Tutorials
In this section we will examine the differences and similarities between JDBC and ORM
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
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
SWINGS
SWINGS  WHAT ARE THE DIFFERENCES BETWEEN AWT AND SWINGS
Java methods
Java methods  What are the differences between == and .equals
HTML
HTML  What are differences between DIV and SPAN
Java basics
Java basics  Differences between applications and applets
 

 

 

DMCA.com