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.
It is very hard to write any program without using variables. And when we use variable, the first thing we want to do is to assign it some values. Variables are like storage of data, so it is natural for us to put some values to this storage. In this post, we will show how to use the assignment operator in Java, which assigns values to a variable.
The most basic way we use a programming language is to develop programs that performs mathematical calculations. The foundation of the most basic of all mathematical operations are arithmetic. Which in most programming languages covers addition, subtraction, division, multiplication, and modulus. Most other mathematical calculations can be done through the use of these basic operations. Below is a tutorial on how to perform arithmetic operations in Java.
This tutorial will show how to read user input when creating a console application. This is very useful when the program you are writing needs to get input from user before it can proceed with processing.
A good way of learning a new language is to analyze a simple application that outputs something to the screen. This tutorial will walk you through a simple Hello World application to help you start your journey with Java.
For Java beginners, I recommend to start with setting up a development environment. It is easier to understand concepts by running actual code and testing them. This Java tutorial is written to help newbie Java programmers to prepare their Windows Development Environment.