Number Operations

There are ways to make modifying integers and other number variables much more quick then they usually are. Want to know how? Read on...

I'll teach you speedy number operations in this tip. Please note: varName represents a variable, so I don't have to explain that to you over and over. varName can be changed with any variable. Now, let's get on with it...

Don't you hate having to write out stuff like:

varName = varName + 1

Well there is an easier way!! You can simply use:

varName ++

This will add 1 to your number. ++ simply adds 1. What if you wanted to add another number, like 5? Well, there's a good way to do this too. Just use:

varName =+ 5

=+ tells JAVA that you're adding to your integer. Just put a number after it and it will be added! Simple! I hope this has been helpful.

You might also like...

Comments

About the author

Jamie Lindgren United States

Uhm... I dunno why I'm typing this, cuz nobody is gonna read it probably, but anyway... I am (guess my age!! haha... 14) years old and I like programming, web design, and graphic design. I'm ...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens