Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Java Tutorial - Compound Assignment Operators

Many times when we want to assign an expression to a given variable, the expression uses simple operation that involves the original value of the variable. For example, a = a + 2 means we want to add 2 to the variable, and assign the value back to it. Java provides a short hand notation for this to make programming more concise and easier to understand. We call it Compound Assignment Operators. We will discuss around 11 of these in this post. Below are examples on how to perform compound assignment operators in Java.



This post first appeared on JavaDevNotes, please read the originial post: here

Share the post

Java Tutorial - Compound Assignment Operators

×

Subscribe to Javadevnotes

Get updates delivered right to your inbox!

Thank you for your subscription

×