10:57:56 Welcome back. So we're gonna do a little bit of review. The last slide we worked with. 10:57:56 Was the Java API, that application programmer interface, and we discussed that the system is part of that. 10:58:04 Library. Well, the thing I want to bring to your attention. Is the difference between input and output. 10:58:12 So system dot out dot print line is an output statement. And let's review. The Java API. 10:58:22 So as you can recall, Java language itself is written as an object. And so you see at the highest level that class Java. 10:58:32 Dot Lang dot object. Okay, and so all of its subclasses or children, we have the Boolean primitive data type, the character. 10:58:45 The object itself, class, math, and then numbers. A notice number has children of its own, the bite, the double the float, the integer long and short. 10:58:56 Then going back out one level, we have the string object and the system object. These are all inherent in the language. 10:59:04 In other words, what does that mean? All of these items. Are built in to the language. So every time you start a program, All of those are built into the language by default. 10:59:20 So you do not need to do anything special. The difference is input, not all programs need keyboard input. 10:59:33 Some utilize files. And so because all programs do not necessarily need keyboard input. The API handles it in a utility package. 10:59:44 As you can recall. In the case of getting user input, we have to import the Java. 10:59:51 Dot Util scanner, see the uppercase S for the object. So this is a little bit of review. 10:59:56 You've seen this in a previous slide, but I wanted to compare and contrast input versus output. Output is built into the language. 11:00:04 We have no problem doing that. Input, we have to use the API and import the scanner. 11:00:10 And as a reminder, The import statement goes above and outside the public class. We have to create or instantiate one of those objects. 11:00:21 We see the keyword there new saying we're gonna create a scanner. We've identified it as keyboard and what are we making a new scanner for specifically system input. 11:00:32 Okay, the standard input device being the keyboard. Then recall that whatever we're asking the user for information, we need to prompt for it first. 11:00:43 So we'll write an output statement making the request for the information that we want. Followed by the input statement gathering that keyboard strokes and storing that information in the variable that we provided. 11:00:59 And this case in this example, it is number. The way you want to think about that 2 step is can you imagine if there was a blinking cursor on the screen with no question, you'd have no idea what to type. 11:01:11 This is why you're always gonna have an output statement first. Requesting the information that you want and then an input statement to gather it. 11:01:24 Okay, so we've mostly been using print line, but there's also print. So what's the difference? 11:01:30 Well, print displays the output to the standard output device, but does not advance the cursor to the new line. 11:01:38 Think when you're typing it a paper and you hit the enter key, it moves it to the new line. 11:01:42 Friend does not move to the new line. So if you have a second print statement, it would just continue on the line that it had started on. 11:01:52 As opposed to print line which prints out the information within the parentheses and that advances the cursor to the next line for future outputs. 11:02:04 There are some sample programs posted at the bottom of this week. Please make sure that you print them and copy and paste and run them. 11:02:15 In J-gras to see what they produce. Okay. And so what kind of information can go in those parentheses in the argument of system outprint or system output line. 11:02:27 Well, that information that can be part of the argument. Is a string literal like our first program hello world where we just said some information within double quotes a variable, okay, now behind the scenes that variable is converted to a string. 11:02:47 Okay, we don't need to worry about that but I want you to understand that it is done by the system. 11:02:52 It converts it to a string to display it to the screen. Also, the Concat operator, I know it looks exactly like the plus or addition side. 11:03:03 This is used to connect strings. We have some examples. Again, in the code that I provided using that concatenate operator. 11:03:12 And when you did hello world 2, we found that concatenate operator in. In there as well. 11:03:18 Now that's also the addition operator when we're doing a mathematical statement. This applies only when you're within the parentheses of an output statement that it acts as a concat operator for strings. 11:03:32 Okay, and please note when concatenating your strings, watch your white space. Do you see what happens when you. 11:03:40 Close the quote and then you open one and you don't put a piece of white space between all your texts will run together. 11:03:47 So please be careful to make your output statements readable. Now, is there anything else that can go in those parentheses besides variable data? 11:03:58 String literals? Yes, there is. And so what else can be part of a string literal? 11:04:06 So literally within the quotes. There are some other commands that you can provide. Okay, and they're called escape sequences. 11:04:17 They all start with a backslash. And here is a short list. Now this is not the all encompassing list of escape sequences, but these are probably the most common ones that you will want to use. 11:04:30 In programming one. The first, the backslash, and advances the cursor to the new line. 11:04:35 So in other words, it behaves like a system outprint line. Okay, there's a backslash T which tabs the work over. 11:04:42 A backslash B, which actually backspaces. Return, back to the beginning of the current line. 11:04:52 A double back splat backslash allows you to be able to print a black backslash in backslash in your output. 11:05:02 And then the last 2 for a single quote or double quote because we use single quotes and double quotes in our code, but what if we actually wanted to write a quote in the output, we'd have to use that backslash and this these escape sequences although they're made up of 2 characters they're treated as a unit 11:05:23 of one character. 11:05:27 One more thing we want to talk about. Now you've run a few labs at this point, but when it was time to save the file, you might notice that where you're storing your files, you have a couple files being made. 11:05:40 You have a source file and a bike code file. Okay, so those file extensions look like this. 11:05:48 Dot Java is your source code file. It's programmer created and it's the one that you can reopen and edit your code. 11:05:57 When you hit the compile button in JGRAS, what happens is that file, your source code file is red and it is then translated into that byte code. 11:06:10 Or dot class file. And this is created by the compiler. Now remember, this is executable by the Java virtual machine. 11:06:20 So in other words, it is not machine code of itself. Remember that Java programming language is an interpreted language. 11:06:28 And so the dot class file is used and interpreted and read by the Java virtual machine so that the that class file can be read on a Mac or a PC or a Linux or a Unix system, it wouldn't matter. 11:06:43 It can still be interpreted as long as there's a Java virtual machine. Okay, so that's a little bit of review. 11:06:53 Please know there are a few more files at the bottom of this week talking about the decimal formatter and print f. 11:07:00 You're going to need those for future programs, especially anything doing with currency. You're gonna want to use probably the decimal format or it works very well. 11:07:10 Familiarize yourself with print app and decimal formatter and the other remaining files that are posted during this week. 11:07:21 Thank you.