Inheritance
Getting started with Java
Streams
Exceptions
Collections
Lambda Expressions
Generics
File I/O
Arrays
Interfaces
Maps
Strings
InputStreams and OutputStreams
Default Methods
Classes and Objects
Basic Control structures
Concurrent Programming Threads
Console I/O
Singletons
Visibility controlling access to members of a class
Regular Expressions
Autoboxing
Documenting Java Code
Executor, ExecutorService and Thread pools
Object Class Methods and Constructor
JAXB
Primitive Data Types
Networking
Optional
Enums
HttpURLConnection
Annotations
Audio
Data Class
Calendar and its Subclasses
Nashorn JavaScript engine
Java Native Interface (JNI)
Remote Method Invocation (RMI)
Iterator and Iterable
Operators
Operators
The IncrementDecrement Operators --
The Conditional Operator
The Bitwise and Logical Operators
Checking setting clearing and toggling individual bits. Using long as bit mask
Operator Precedence
The Arithmetic Operators -
The String Concatenation Operator
The Instanceof Operator
The Assignment Operators - and
The conditional-and and conditional-or Operators and
The Shift Operators and
The Equality Operators
The Lambda operator -
The Relational Operators
Asserting
Scanner
Properties Class
Preferences
Reflection API
Constructors
ByteBuffer
Serialization
JSON in Java
Random Number Generation
Recursion
Polymorphism
StringBuilder
Refernce Data Types
Bit Manipulation
Java Agents
Encapsulation
Type Conversion
BigInteger
BigDecimal
RSA Encryption
Varargs Variable Arguments
ThreadLocal
Logging
static keyword
Disassembling and Decompling
Resources on classpath
log4j, log4j2
JVM Flags
Oracle Official Code Standard
Character encoding
Java Memory Management
Immutable Objects
Object Cloning
Alternative Collections
Lists
BufferedWriter
LocalTime
Sets
Comparable and Comparator
JVM Tool Interface
Nested and Inner Classes
Apache Commons Lang
Getters and Setter
The Classpath
Bytecode Modification
XML Parsing using JAXP
Reference Types
Localization and Internationalization
JAX-WS
XML XPath Evaluation
Performance Tuning
Parallel programming with ForkJoin framework
Common Pitfalls
Non-Access Modifiers
Java Compiler
XJC
Installing Java Standard Edition
Process
Command line argument processing
Dates and Time using java.time
Fluent Interface
XOM - XML Object Model
Just in Time JIT compiler
FTP File Transfer Protocol
Java Native Access JNI
Modules
Pitfalls - exceptions
Pitfalls - language syntax
ServiceLoader
ClasssLoader
Object References
Pitfalss - performance
Creating Images Programmatically
Applets
NIO Networking
New File I/O
Secure objects
Pitfalls - threads and concurrency
Splitting a string into fixed length parts
Pitfalls - nulls and NullPointerException
SecurityManager
JNDI
super keyword
java.util.Objects class
Java command: java and javaw
Atomic types
Floating Point Operations
Converting to and from strings
sun.misc.Unsafe
Java Memory Model
Java deployment
Java plugin system implementations
Queues and deques
Runtime commands
NumberFormat
Security and Cryptograhy
Java Virtual Machine JVM
Unit Testing
JavaBean
Expressions
Literals
Java SE 8 Features
Java SE 7 Features
Packages
Concurrency and Money
Concurrent Collections
Using ThreadPoolExecutor in multi-threaded applications
Java Editions, versions, releases and distributions
Dynamic method dispatch
JMX
Security and cryptography
Generating Java Code
JShell
Benchmarks
Collection Factory Methods
Multi-release JAR files
Stack-Walking API
TreeMap and TreeSet
Sockets
Java Sockets
Using other scripting languages in Java
Functional interfaces
List vs. set
2D graphics
Reflection
Deque interface
Enum Map
EnumSet class
Local Inner class
Java Print Service
Immutable class
String Tokenizer
File upload to S3 / AWS
Readers and writers
Hashtable
Enum starting with a number
SortedMap
WeakHashMap
LinkedHashMap
StringBuffer
Choosing Collections
C++ Comparison
CompletableFuture
Contributors

The IncrementDecrement Operators --

suggest change

Variables can be incremented or decremented by 1 using the ++ and -- operators, respectively.

When the ++ and -- operators follow variables, they are called post-increment and post-decrement respectively.

int a = 10;
a++; // a now equals 11
a--; // a now equals 10 again

When the ++ and -- operators precede the variables the operations are called pre-increment and pre-decrement respectively.

int x = 10;
--x; // x now equals 9
++x; // x now equals 10

If the operator precedes the variable, the value of the expression is the value of the variable after being incremented or decremented. If the operator follows the variable, the value of the expression is the value of the variable prior to being incremented or decremented.

int x=10;

System.out.println("x=" + x + " x=" + x++ + " x=" + x); // outputs x=10 x=10 x=11
System.out.println("x=" + x + " x=" + ++x + " x=" + x); // outputs x=11 x=12 x=12
System.out.println("x=" + x + " x=" + x-- + " x=" + x); // outputs x=12 x=12 x=11
System.out.println("x=" + x + " x=" + --x + " x=" + x); // outputs x=11 x=10 x=10

Be careful not to overwrite post-increments or decrements. This happens if you use a post-in/decrement operator at the end of an expression which is reassigned to the in/decremented variable itself. The in/decrement will not have an effect. Even though the variable on the left hand side is incremented correctly, its value will be immediately overwritten with the previously evaluated result from the right hand side of the expression:

int x = 0; 
x = x++ + 1 + x++;      // x = 0 + 1 + 1 
                        // do not do this - the last increment has no effect (bug!) 
System.out.println(x);  // prints 2 (not 3!)

Correct:

int x = 0;
x = x++ + 1 + x;        // evaluates to x = 0 + 1 + 1
x++;                    // adds 1
System.out.println(x);  // prints 3

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents
11 Maps
26 JAXB
30 Enums
33 Audio
76 Lists
79 Sets
90 JAX-WS
97 XJC
107 Modules
115 Applets
123 JNDI
151 JMX
154 JShell
160 Sockets