Answers for "pre increment and post increments"

0

pre increment and post increments

int x =0;
// POST increments: increments after it prints x or stmt  
System.out.println("Hello World"+ x++); // 0 
System.out.println("Hello World"+ x); // 1

// PRE increments: increments before it prints x or stmt  
System.out.println("Hello World"+ ++x); // 1
System.out.println("Hello World"+ x); // 1
Posted by: Guest on March-21-2022

Code answers related to "pre increment and post increments"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language