![start program magic unipaas public name start program magic unipaas public name](http://3.bp.blogspot.com/-wJceTvTBeL4/Tph_VImg59I/AAAAAAAAAP4/rjqz1IqyGZA/s1600/First_Image_Added.jpg)
There are 8 primitive types of data built into the Java language. The amount of memory allocated for a given variable and how the value of that variable should be stored in memory depends upon its type. A variable in Java gives us a way to store values (or other kinds of information) for later use, addressing all of the aforementioned considerations. The concept of a variable solves all of our problems here. The computer also needs to have some reference to where it stored the value, so it can find it again. Examples of types of encodings used include Two's Complement, IEEE 754 Form, ASCII, Unicode, etc. Further, we also need to tell the computer how the value should be stored in memory (i.e., what method of "encoding" should be employed to turn the value into a string of 1's and 0's). For example, it will certainly take more memory to store the Declaration of Independence than it will to store a single letter (i.e., a "character"). These things too, come in different sizes. Of course, we sometimes need to store things other than numbers. Different kinds of numbers require different amounts of memory (more on this in a minute). We need to tell the computer how much memory will be needed to store the value in question. Looking at step 1 in the program above, we will need to tell the computer that it needs to remember the value it is reading in - it needs to store this value in its memory somewhere so we can use it in a computation later. Remember: a computer will read and act upon these instructions one at a time - it is not aware of what is coming up until it gets there! Print the area to the standard output stream (i.e., the console window) Read a value representing the radius of a circle from the standard input source/streamĬompute the area of a circle with this radius You can think of a simple program as a list of instructions to be read and acted upon sequentially The Purpose of a Variable (and some vocabulary)