Welcome back to Knowledge City's course on programming in Java. My name is Cliff Brozo, I'm your instructor. And today we're going to write a program that features a whole lot of different variable data types. We're going to try to use them all and explain not only how to declare them, but how to read them in using the keyboard input and then how to print them out. So let's take a look at our program. We start in line one importing the Java util scanner information. That's going to allow us to read data in from the keyboard. Then lines three, four, and five are what we've seen before, a public class of main, and our public static void main string arcs. I love putting comments in programs because it describes what I'm doing and why I'm doing it. In this case, from lines seven through 15, I'm putting in comments that say these are the different types of variables and the different data types that exist in Java. Strings are used to store words and are enclosed in double quotes. Int is used to store very large integers from minus 2 billion to plus 2 billion. There's a long int for even larger numbers. Float will store numbers that contain decimal positions. A double contains a larger number of decimal positions. Most programmers use int and double. Character, C-H-A-R, is used to store single characters and those are enclosed in single quotes. And a good trick is to remember single characters, single quotes, double characters, double quotes. Finally a boolean variable, true or false values only. Boolean was invented by a man named George Bool. In line 16 I declare three variables, three strings. And as you can see, the keyword string is coded in red. Wage string, dependent string and employee name. I'm gonna need those things as I read the data in. You'll see why in a second. Following that is my character to store the person's gender. It's a single letter code to store whatever gender the user has. My boolean variable is a programming technique that a lot of people use that starts the variable name with is because you're asking a question. And remember, the answer's going to be true or false. So, is this person a 20-year employee? I'll give it initial value of false. Next up, I have two variables, both are doubles. So they're going to be very precise in terms of the number of decimals they store. Wage and weekly pay, and lastly, I've got an integer to store dependents. Here's one more variable that we haven't talked about and it includes the word final. And it's different from the others because this one is in all capital letters. Final means it won't change. It can't change. And by putting this variable in upper case it's a key to the person reading the program that this variable is never going to change and we can't even try to change it. And what we're saying here is that there are 37 and a half hours in a workweek. In line 32 I start sectioning off my program. I like to put in a big, long line that says this area is for getting the data input. When I'm reading programs and they get to be hundreds of lines long, I like to visually see what area of the program I'm dealing with. Let's take a look. In line 34 I declare a new scanner and attach that scanner to the system input device, better known as the keyboard. Than in 36 and 37 I ask for the person to type in the employee name. And that name is stored in the variable employee name. In line 39 and 40 I have a different way of getting the data. Now that I have the employee name, I will use it in the program. The output line will say, Cliff Brozo has worked here for 20 years, true or false, and the user will type in the data true or false. In order to make sure that turns into a Boolean data type, I need to use the word parse Boolean in order to take what was typed in on that line and change it to a Boolean value. And you'll see how that works in a second.