Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

postfix operator in java

sout(X++ * ++X * X++)

1) first postfix operator: X++ 
   1.a) X++ "replaced" by 10
   1.b) X incremented by one: 10+1=11
   At this step it should look like:  System.out.println(10 * ++X * X++), X = 11;

2) second POSTfix operator: X++ 
   2.a) X++ "replaced" by 11
   2.b) X incremented by one: 11+1=12
   At this step it should look like:  System.out.println(10 * ++X * 11), X = 12;

3) prefix operator: ++X
   3.a) X incremented by one: 12+1=13
   3.b) ++X "replaced" by 13
   At this step it should look like:  System.out.println(10 * 13 * 11), X = 13;

4) evaluating 10*13 = 130, 130*11 = 1430.
Comment

PREVIOUS NEXT
Code Example
Java :: java 8 stream add to list 
Java :: polimorfismo java ejemplo 
Java :: Java Enum ordinal() 
Java :: multiple root tags android manifest 
Java :: jlabel icon size 
Java :: android cella 20*20 java 
Java :: iptc classification java code example 
Java :: get random word from xz file 
Java :: java manipulate alphabet list 
Sql :: delete all nodes neo4j 
Sql :: delete mysql ubuntu 20.04 
Sql :: brew restart mysql 
Sql :: set password for postgres user ubuntu 
Sql :: postgres get all tables in schema 
Sql :: sql change column types 
Sql :: oracle get current schema 
Sql :: alter table add comment oracle 
Sql :: sql now - 1 day 
Sql :: mysql group by month 
Sql :: oracle kill session 
Sql :: mysql show table column comments sql 
Sql :: Found option without preceding group in config file: /etc/mysql/mariadb.conf.d/50-server.cnf at line: 1 
Sql :: wordpress sql find and replace 
Sql :: drush sql-dump 
Sql :: sql getdate date only 
Sql :: mysql history command 
Sql :: import database in mysql command line xampp 
Sql :: file /etc/init.d/mysql not exists 
Sql :: sql pick random row 
Sql :: oracle alter sequence nextval 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =