WEBVTT 1 00:00:00.117 --> 00:00:02.003 In this demo I'm going to enter some 2 00:00:02.004 --> 00:00:03.220 statements in the CodePad 3 00:00:03.228 --> 00:00:06.110 and the first statement I enter will simply declare 4 00:00:06.111 --> 00:00:08.001 and assign a value to a variable 5 00:00:08.003 --> 00:00:10.118 that I'm going to use in the other statements. 6 00:00:11.002 --> 00:00:13.113 I'll declare and Integer variable X 7 00:00:13.114 --> 00:00:15.221 and assign that a value of zero 8 00:00:15.226 --> 00:00:18.222 and end the statement with a semi-colon. 9 00:00:20.221 --> 00:00:23.007 Now I'm going to enter a statement that changes the value 10 00:00:23.008 --> 00:00:27.222 of that variable X, I'm going to assign a new value to X 11 00:00:28.003 --> 00:00:30.001 so I need the assignment operator 12 00:00:30.113 --> 00:00:33.008 and what I'm going to assign to it is an expression 13 00:00:33.116 --> 00:00:36.117 that contains the current value of X 14 00:00:37.004 --> 00:00:39.116 and adds ten onto its value, 15 00:00:40.007 --> 00:00:44.004 and again I end the statement with a semi-colon 16 00:00:45.115 --> 00:00:47.005 and nothing obviously happens there 17 00:00:47.110 --> 00:00:49.003 to see the effect of that statement 18 00:00:49.007 --> 00:00:51.007 I have to type the name of the variable 19 00:00:51.113 --> 00:00:54.009 as an expression without the semi-colon 20 00:00:54.223 --> 00:00:57.112 and press enter, and I see that 21 00:00:57.113 --> 00:01:00.223 the value has changed from zero to ten. 22 00:01:02.002 --> 00:01:05.119 Next I'm going to try a statement with a decrement operator 23 00:01:05.226 --> 00:01:09.113 so X and the decrement operator 24 00:01:10.113 --> 00:01:14.001 and again end the statement with a semi-colon 25 00:01:14.228 --> 00:01:18.003 and again nothing obvious happens because its a statement 26 00:01:18.113 --> 00:01:21.115 and I need to enter the value of the variable to see 27 00:01:21.116 --> 00:01:23.225 the effect thats had, and that has decremented 28 00:01:23.226 --> 00:01:25.115 the value of X. 29 00:01:27.008 --> 00:01:29.118 Finally I'm going to write a statement to declare 30 00:01:29.119 --> 00:01:31.229 and initialise another variable Y 31 00:01:32.110 --> 00:01:35.009 if I tried to use that variable before I declare it 32 00:01:35.119 --> 00:01:38.004 I get an error so lets declare 33 00:01:38.009 --> 00:01:40.006 this is going to be a double 34 00:01:41.002 --> 00:01:43.119 and I'll give it some value 35 00:01:46.007 --> 00:01:49.221 and execute the statement, now I should be able to see 36 00:01:49.226 --> 00:01:52.226 just by typing the name of the variable that 37 00:01:53.001 --> 00:01:55.007 the variable exists because its been declared 38 00:01:55.111 --> 00:01:57.229 and it has the value I assigned to it.