1
00:00:00,210 --> 00:00:07,590
And another point that I want to actually explain about the variables is that you can actually declare

2
00:00:08,430 --> 00:00:10,980
different variables with different names.

3
00:00:10,980 --> 00:00:11,580
OK.

4
00:00:11,580 --> 00:00:16,550
You can't declare different variables of it actually the same name.

5
00:00:16,590 --> 00:00:21,890
For example if I just want to create another variable with the data type in it.

6
00:00:22,350 --> 00:00:30,450
And again if I want to actually copy and paste this variable name OK for this variable.

7
00:00:30,480 --> 00:00:31,710
For this new variable.

8
00:00:31,920 --> 00:00:38,130
And then if you want to actually assign a value to this variable as you can see it's now showing us

9
00:00:38,130 --> 00:00:38,670
an error.

10
00:00:38,700 --> 00:00:47,040
Ok so if my heart can hover my mouse pointer over the error area here as you can see it says duplicate

11
00:00:47,040 --> 00:00:49,190
local variable variable name.

12
00:00:49,320 --> 00:00:56,600
So now it's complaining that we have actually duplicated this variable name here.

13
00:00:56,730 --> 00:01:02,970
So we just need to change this second variable name and as you can see I changed this second variable

14
00:01:02,970 --> 00:01:05,340
name to variable names.

15
00:01:05,380 --> 00:01:06,720
Now the error is gone.

16
00:01:06,830 --> 00:01:07,350
OK.

17
00:01:07,500 --> 00:01:17,190
As I said before variables are nothing but reserved memory locations to store values are great and variables

18
00:01:17,250 --> 00:01:22,610
are just actually placeholders for data in our program.

19
00:01:22,890 --> 00:01:31,320
This means that when you create a variable in your program OK you reserve some space in memory based

20
00:01:31,410 --> 00:01:33,260
on the data type of a variable.

21
00:01:33,300 --> 00:01:41,350
The operating system allocates memory and decides what can be stored in the reserved memory.

22
00:01:41,460 --> 00:01:50,970
OK so by assigning different data types to variables you can store integers decimals or characters in

23
00:01:50,970 --> 00:01:52,020
those variables.

24
00:01:52,130 --> 00:01:55,220
OK and there are two data types in Java.

25
00:01:55,230 --> 00:02:02,300
OK the first one is primitive data types OK.

26
00:02:02,790 --> 00:02:05,500
Which you are already familiar with like this.

27
00:02:05,520 --> 00:02:10,510
Int data type this into data type is actually primitive data type.

28
00:02:10,530 --> 00:02:11,300
OK.

29
00:02:11,970 --> 00:02:19,410
And the second one is object or actually reference

30
00:02:22,210 --> 00:02:24,950
data types.

31
00:02:25,420 --> 00:02:30,820
For now just ignore this object or reference data types or later in the section.

32
00:02:30,820 --> 00:02:38,020
I'll teach you more about these actual data types but for now we just want to focus on primitive data

33
00:02:38,020 --> 00:02:41,980
types and I think that's enough for this tutorial.

34
00:02:42,160 --> 00:02:48,010
And in the next year or Oriol I'm going to teach you more about primitive data types and how you can

35
00:02:48,010 --> 00:02:49,760
use them in your job programs.

36
00:02:49,780 --> 00:02:54,790
OK so thanks for watching and I'll see you in the next tutorial.

