Apache web server for windows - Chapter 4: Making the Most of Variables and

Chapter 4: Making the Most of Variables and Their Values 75 type that amountInAccounthas and whatever value amountInAccount currently represents) is the variable itself. If you think this distinction between variable and variable name is too subtle for you to worry about, join the club. Every variable name is an identifier a name that you can make up in your own code. In preparing Listing 4-1, I made up the name amountInAccount. For more information on the kinds of names in a Java program, see Chapter 3. Before the sun sets on Listing 4-1, you need to notice one more part of the listing. The listing has 50.22and 1000000.00in it. Anybody in his or her right mind would call these things numbers, but in a Java program it helps to call these things literals. And what s so literal about 50.22and 1000000.00? Well, think about the variable amountInAccountin Listing 4-1. The variable amountInAccount stands for 50.22 some of the time, but it stands for 1000050.22 the rest of the time. You could sort of use the word number to talk about amountInAccount. But really, what amountInAccountstands for depends on the fashion of the moment. On the other hand, 50.22literally stands for the value 5022/ 100. A variable s value changes; a literal s value doesn t. Assignment Statements Statements like the ones in Listing 4-1 are called assignment statements. In an assignment statement, you assign a value to something. In many cases, this something is a variable. I recommend getting into the habit of reading assignment statements from right to left. For instance, the first line in Listing 4-1 says, Assign 50.22… amountInAccount = 50.22; …to the amountInAccount variable. The second line in Listing 4-1 is just a bit more complicated. Reading the second line from right to left, you get Add 1000000.00 to the value that s already in the amountInAccount variable…
Our facility is located in Orlando, Florida. Our Orlando web hosting data center gives you assurance that your website will work smoothly . Check more in Orlando Web Hosting.

Leave a Reply