1
00:00:00,360 --> 00:00:04,270
And this is the address of this my life an object inside the memory.

2
00:00:04,290 --> 00:00:04,960
OK.

3
00:00:05,200 --> 00:00:05,760
OK.

4
00:00:05,910 --> 00:00:13,710
So now that my object is created all you want to actually access its characteristics and behaviors and

5
00:00:13,710 --> 00:00:15,740
then output them to the console.

6
00:00:15,840 --> 00:00:23,270
So now I just need to type in here sister data out that print to learn and that inside the prentices

7
00:00:23,800 --> 00:00:31,840
I just need to refer to the name of my object my lion and then I want to access its speed instance valuable.

8
00:00:32,020 --> 00:00:37,960
So I just use the dot notation here and then I choose this instance variable.

9
00:00:38,560 --> 00:00:43,690
And then at the end of my statement I need to put in a semicolon and if I get on my project.

10
00:00:43,720 --> 00:00:50,630
Now as you can see this is the value of this instance variable of this specific object.

11
00:00:50,650 --> 00:00:51,340
OK.

12
00:00:52,120 --> 00:00:56,260
So the value of this split instance variable is 90.

13
00:00:56,260 --> 00:00:56,690
OK.

14
00:00:56,710 --> 00:01:03,810
And now I want to output the value of the power instance variable of this object.

15
00:01:03,820 --> 00:01:04,280
OK.

16
00:01:04,420 --> 00:01:14,150
So here I just need to typing system that out that print learn and then inside the prentices I just

17
00:01:14,150 --> 00:01:21,530
need to refer to the name of my object and then I use the dot notation here in order to access the power

18
00:01:21,530 --> 00:01:22,570
instance variable.

19
00:01:22,590 --> 00:01:24,260
Ok power.

20
00:01:25,100 --> 00:01:30,800
And then at the end of my statement I need to put in a semi-colon and if I get on my project now this

21
00:01:30,800 --> 00:01:37,940
value is the value of the power instance variable of this specific object.

22
00:01:37,960 --> 00:01:39,450
OK my lawyer an object.

23
00:01:39,580 --> 00:01:43,460
OK so now I want to actually access the behaviors of my lawyer.

24
00:01:43,480 --> 00:01:44,090
OK.

25
00:01:44,270 --> 00:01:51,480
So first I need to refer to the name of my object and then I use the dot notation here.

26
00:01:51,560 --> 00:01:54,010
And then I want to actually tell my lawyer to roll.

27
00:01:54,110 --> 00:01:54,640
OK.

28
00:01:54,830 --> 00:02:00,790
So I just need to take in her role as you can see here in this line of code in line 14.

29
00:02:00,890 --> 00:02:03,940
I am telling my lawyer object to roll.

30
00:02:03,980 --> 00:02:04,540
OK.

31
00:02:04,670 --> 00:02:11,100
So now if I run my project as you can see this is the value that is output to the console okay.

32
00:02:11,270 --> 00:02:15,760
Or I may want to actually tell my lion to run.

33
00:02:15,940 --> 00:02:16,510
OK.

34
00:02:16,610 --> 00:02:19,330
So I just need to refer to the name of the object.

35
00:02:19,880 --> 00:02:26,450
And then I use the dot notation here and then I tell my client to run.

36
00:02:26,890 --> 00:02:27,590
OK.

37
00:02:27,980 --> 00:02:34,250
So now if I run on my project as you can see this is the value that is output to the console run ok.

38
00:02:34,250 --> 00:02:37,540
For example my line is now running OK.

39
00:02:37,910 --> 00:02:42,880
And then I want to tell my lawyer to actually fight.

40
00:02:42,890 --> 00:02:43,440
OK.

41
00:02:43,580 --> 00:02:50,750
So again I need to refer to the name of my object that fight and if I get on my project.

42
00:02:50,770 --> 00:02:56,130
Now as you can see my lion is actually fighting now OK.

43
00:02:56,330 --> 00:02:59,100
This is the value that is output to the console fight.

44
00:02:59,310 --> 00:02:59,920
OK.

45
00:02:59,960 --> 00:03:06,680
Or I may want to actually tell my lawyer to sleep so I just need to refer to the name of my object my

46
00:03:06,680 --> 00:03:09,090
lawyer and that sleep.

47
00:03:09,650 --> 00:03:14,510
And if I run my project now as you can see this is the value that is outputted to the console.

48
00:03:14,750 --> 00:03:16,980
For example my lion is now sleeping.

49
00:03:17,000 --> 00:03:17,390
OK.

50
00:03:17,420 --> 00:03:23,690
So first my line is going I actually wrote and then it's going to run and then it's going to fight.

51
00:03:23,990 --> 00:03:27,420
And then my line is going I should sleep OK.

52
00:03:27,650 --> 00:03:37,310
So this is how you can actually access the characteristics or instance variables and the behaviors of

53
00:03:37,310 --> 00:03:38,160
your objects.

54
00:03:38,180 --> 00:03:38,930
OK.

55
00:03:39,620 --> 00:03:41,720
So now let me show you another example.

56
00:03:42,020 --> 00:03:50,290
So first let me actually comment out these lines of code here and here I can actually create another

57
00:03:50,320 --> 00:03:53,510
object of this class.

58
00:03:53,530 --> 00:04:04,800
So I just need to refer to the name of my lion class and the name of my lion object is my second lion.

59
00:04:05,250 --> 00:04:12,960
And then I put an assignment operator here and then I use this keyboard here new and again I need to

60
00:04:12,960 --> 00:04:19,150
refer to the name of my class and that I need to put in a pair of round brackets after my class name

61
00:04:19,170 --> 00:04:19,650
OK.

62
00:04:19,830 --> 00:04:23,600
And then I need to put in a semicolon at the end of my statement.

63
00:04:23,640 --> 00:04:30,630
So now I can actually access the instance variables or behaviors of these.

64
00:04:30,690 --> 00:04:32,080
My second line object.

65
00:04:32,100 --> 00:04:32,560
OK.

66
00:04:32,790 --> 00:04:40,530
So now I want to show you another way of creating objects so like variables we can first declare our

67
00:04:40,620 --> 00:04:42,060
objects.

68
00:04:42,270 --> 00:04:52,200
So now as you can see here in 9:19 I am actually declaring that I am going to create an object from

69
00:04:52,200 --> 00:04:52,990
the lower class.

70
00:04:53,030 --> 00:04:56,510
OK but I didn't actually instantiate this object.

71
00:04:56,520 --> 00:04:56,920
OK.

72
00:04:56,940 --> 00:05:05,820
First before I can actually access the characteristics or behaviors of these Lalia object I need to

73
00:05:05,970 --> 00:05:07,880
first instantiated.

74
00:05:07,890 --> 00:05:14,760
So for example in line to anyone I can instantiate my search like an object I need to refer to the name

75
00:05:14,760 --> 00:05:15,620
of my object.

76
00:05:15,630 --> 00:05:22,990
My second luggin and I puts an assignment operator here and then I put this key word here new.

77
00:05:23,430 --> 00:05:29,560
And then I refer to the name of my class and then I put a pair of round brackets at the end of my class.

78
00:05:29,790 --> 00:05:30,500
OK.

79
00:05:31,170 --> 00:05:37,770
So as you can see here now in line 21 I am actually instantiating my second line object.

80
00:05:37,780 --> 00:05:38,250
OK.

81
00:05:38,460 --> 00:05:44,640
And now I can access the characteristics or behaviors of DS.

82
00:05:44,670 --> 00:05:46,090
My second like an object.

83
00:05:46,090 --> 00:05:46,690
OK.

84
00:05:47,040 --> 00:05:55,470
So I can just take in here system that out that learn and then inside the apprentice's I can just refer

85
00:05:55,470 --> 00:05:58,680
to the name of my object that speed

86
00:06:02,170 --> 00:06:06,580
I want to output the value of the power instance variable to the console.

87
00:06:06,610 --> 00:06:13,470
So I just need to type in here system that out that print to learn and that in say the apprentice's

88
00:06:13,560 --> 00:06:21,120
I need to refer to the name of my object my second life and that power or I may want to access the behaviors

89
00:06:21,300 --> 00:06:22,890
of my life and object.

90
00:06:23,070 --> 00:06:33,960
So I just need to refer to the name of my object my my second line that wrote my second line in thought

91
00:06:34,520 --> 00:06:45,120
Ron my second lie in that fight my second life in that sleep.

92
00:06:45,140 --> 00:06:52,880
So as you can see here I successfully managed to actually access the characteristics and behaviors of

93
00:06:52,880 --> 00:06:53,870
my life and object.

94
00:06:53,870 --> 00:06:54,650
OK.

95
00:06:54,890 --> 00:07:03,320
So now if you are on my project as you can see these are the values of the characteristics or behaviors

96
00:07:03,530 --> 00:07:05,220
of my second line object.

97
00:07:05,240 --> 00:07:05,730
OK.

98
00:07:05,810 --> 00:07:13,710
So now if I actually comment out this line of code here now the eclipse is complaining and is now showing

99
00:07:13,770 --> 00:07:15,450
us lots of errors.

100
00:07:15,450 --> 00:07:16,030
OK.

101
00:07:16,500 --> 00:07:25,560
It's telling us that we need to actually instantiate our object before we can actually access the instance

102
00:07:25,560 --> 00:07:29,290
variables or behaviors of that specific object.

103
00:07:29,340 --> 00:07:35,020
OK so in line 21 we are actually instantiating and it's my second layer and object.

104
00:07:35,040 --> 00:07:35,510
OK.

105
00:07:35,610 --> 00:07:43,950
So that's it for actually objects and methods and that's how you can actually access the characteristics

106
00:07:44,010 --> 00:07:46,700
or the behaviors of your objects.

107
00:07:46,710 --> 00:07:47,220
OK.

108
00:07:47,550 --> 00:07:51,370
So if you have any questions please post the discussion in the course.

109
00:07:51,450 --> 00:07:55,830
Thank you very much for watching and I'll see you in the next tutorial.

