Showing posts with label integer. Show all posts
Showing posts with label integer. Show all posts

Friday, February 8, 2013

Week-2: 2.1: Variable: Integer


Programs work by manipulating data placed in memory. The data can be numbers, text,
objects, pointers to other memory areas, and more besides. The data is given a name, so that it
can be re-called whenever it is need. The name, and its value, is known as a Variable. We'll start
with number values.

To store a number in java, you have lots of options. Whole numbers such as 8, 10, 12, etc, are
stored using the int variable. (The int stands for integer.) Floating point numbers like 8.4, 10.5,
12.8, etc, are stored using the double variable. You do the storing with an equals sign ( = ). Let's
look at some examples (You can use your FirstProject code for these examples).

Click for Details