- Related Questions & Answers
- Difference between x++ and x = x+1 in Java
- Difference between NumberLong(x) and NumberLong(“x”) in MongoDB?
- Sum of the Series 1 + x/1 + x^2/2 + x^3/3 + .. + x^n/n in C++
- Absolute difference between the first X and last X Digits of N?
- Count Elements x and x+1 Present in List in Python
- Python Program to Generate a Dictionary that Contains Numbers (between 1 and n) in the Form (x,x*x).
- Differences between Python 2.x and Python 3.x?
- Difference between %p and %x in C/C++
- Program to find sum of 1 + x/2! + x^2/3! +…+x^n/(n+1)! in C++
- Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors in C++
- Important differences between Python 2.x and Python 3.x with examples
- What are the key differences between Python 2.7.x and Python 3.x?
- Construct a frequency array of digits of the values obtained from x^1, x^2, ....., x^n in C++
- Find minimum x such that (x % k) * (x / k) == n in C++
- Find larger of x^y and y^x in C++

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

x++ automatically handles the type casting where as x= x + 1 needs typecasting in case of x is not an int variable. See the example below.

public class Tester { public static void main(String args[]) { byte b = 2; //Type casting is required //as 1 is int and b is byte variable b = (byte) (b + 1); System.out.println(b); byte b1 = 2; //Implcit type casting by the compiler b1++; System.out.println(b1); } }

3 3

Advertisements