There are no ++ or -- operators in Scala (use += or -=)

In Scala there are no ++ or -- operators. You should instead use the += and -= operators, as shown below. First the += operator:

scala> var i = 1
i: Int = 1

scala> i++
<console>:9: error: value ++ is not a member of Int

scala> i += 1

scala> println(i)

Next the -= operator:

Linux shell scripts: How to increment a counter in a shell script

Unix/Linux shell script FAQ: Can you share a simple Linux shell script that shows how to count, i.e., a shell script that increments a counter in a for loop or while loop?

Sure, I just needed to increment a while loop counter myself, so I thought I'd share my example shell script code here.

AppleScript math: Addition, subtraction, multiplication, division

AppleScript math FAQ: Can you show some examples of basic AppleScript math operations, like addition, subtraction, multiplication, and division?

Sure, let's take a look at some AppleScript math examples.

AppleScript addition syntax/examples

To add a few numbers together just use the normal set syntax and the + operator, like this AppleScript addition example:

set one to 1
set two to 2
set answer to one + two
display dialog answer

That example displays the number 3.

Java int - How do I add two integers?

Java integer FAQ: How do I add two Java integers (Java int fields)?

Answer: Just use the Java addition operator, the plus sign (+), to add two integers together.

Here's a quick example: If you have to drive 23 miles east, then 14 miles north, what is the total distance you had to drive?