WEBVTT 1 00:00:00.223 --> 00:00:02.008 In this demo I'm going to show you how 2 00:00:02.009 --> 00:00:03.229 to use an output statement 3 00:00:04.118 --> 00:00:07.224 this statement writes its output to the terminal window 4 00:00:08.008 --> 00:00:09.227 I'm going to be using the CodePad 5 00:00:10.000 --> 00:00:12.119 but output statements work in exactly the same way in the 6 00:00:12.220 --> 00:00:14.114 code for a Java class. 7 00:00:16.009 --> 00:00:19.000 So the statement looks like this, system 8 00:00:20.222 --> 00:00:23.006 dot out dot 9 00:00:24.002 --> 00:00:25.115 println 10 00:00:25.225 --> 00:00:27.119 and then whatever we want to print out and 11 00:00:27.220 --> 00:00:30.224 I'm just going to print out string hello 12 00:00:31.006 --> 00:00:32.228 end that with a semi-colon 13 00:00:33.113 --> 00:00:37.117 and that should print the word hello to the terminal window. 15 00:00:39.114 --> 00:00:42.001 I can also print out the value of a variable 16 00:00:42.116 --> 00:00:46.111 lets go to the CodePad and declare a variable 17 00:00:47.112 --> 00:00:49.221 X, give it a value 18 00:00:50.002 --> 00:00:53.228 and then we'll print it out, to save myself a little bit of typing 19 00:00:54.002 --> 00:00:56.112 I can use the up arrow key 20 00:00:56.228 --> 00:00:59.008 couple of times that brings back the last 21 00:00:59.113 --> 00:01:02.004 few commands that I executed 22 00:01:02.009 --> 00:01:05.223 and then I can just backspace and 23 00:01:06.114 --> 00:01:09.003 replace the string with what I want 24 00:01:09.004 --> 00:01:10.223 to print out this time and thats 25 00:01:11.006 --> 00:01:13.226 the variable, X the name of the variable 26 00:01:15.008 --> 00:01:17.229 and enter and that prints out the value 27 00:01:18.000 --> 00:01:20.222 three of the variable X.