WEBVTT 1 00:00:00.222 --> 00:00:01.220 In this demo 2 00:00:01.225 --> 00:00:03.117 I'm going to declare some variables 3 00:00:03.118 --> 00:00:05.226 and initialise them with suitable values. 4 00:00:06.006 --> 00:00:08.007 Lets start with an Integer. 5 00:00:08.227 --> 00:00:12.116 To declare a variable I need to specify the type int 6 00:00:12.119 --> 00:00:16.221 and give it a name, I'm just going to call it myInteger 7 00:00:17.006 --> 00:00:20.006 and I'm going to assign a value of ten 8 00:00:20.116 --> 00:00:22.005 and hit return. 9 00:00:22.113 --> 00:00:24.226 I can check that the variable has a value 10 00:00:24.229 --> 00:00:28.113 I expect just by typing its name 11 00:00:29.112 --> 00:00:33.004 and BlueJ tells me the value and the type 12 00:00:34.114 --> 00:00:36.003 lets try a float 13 00:00:42.110 --> 00:00:47.002 float values are written as decimal numbers with an f 14 00:00:48.226 --> 00:00:52.006 and I can check the value of that variable 15 00:00:52.114 --> 00:00:54.111 by typing its name 16 00:00:54.225 --> 00:00:57.112 and we can see the value and type. 17 00:00:59.117 --> 00:01:01.223 How about a double 18 00:01:05.006 --> 00:01:08.228 and a double value is just written as a decimal number. 19 00:01:15.001 --> 00:01:16.227 Now a boolean 20 00:01:20.221 --> 00:01.23.221 boolean variable can only have one of two possible values 21 00:01:23.222 --> 00:01:27.221 either true or false, lets make this one true. 22 00:01:33.007 --> 00:01:36.115 A char variable holds a single character 23 00:01:39.221 --> 00:01:44.115 and char values are written in single quotes like this. 24 00:01:52.118 --> 00:01:54.228 Finally a string 25 00:01:57.005 --> 00:01:59.111 a string is a sequence of characters 26 00:01:59.116 --> 00:02:02.220 thats written in double quotes. 27 00:02:09.229 --> 00:02:12.005 Note that the value of a string is shown with an 28 00:02:12.006 --> 00:02:15.001 extra symbol alongside it in the CodePad 29 00:02:15.110 --> 00:02:17.111 we'll learn more about that later on.