1
00:00:00,510 --> 00:00:08,100
Our class can have several different constructors each with a different number or type of argument when

2
00:00:08,100 --> 00:00:09,860
you use the new keyboard.

3
00:00:10,020 --> 00:00:18,180
You can specify different arguments in the argument list and the correct constructor for those arguments

4
00:00:18,240 --> 00:00:19,150
is called.

5
00:00:19,350 --> 00:00:25,350
So in the previous tutorials I showed you how you can actually create different constructors and how

6
00:00:25,350 --> 00:00:27,210
you can call those constructors.

7
00:00:27,210 --> 00:00:27,680
OK.

8
00:00:27,810 --> 00:00:34,580
In this example here in this application as you can see here as three tokenizer class has multiple constructors.

9
00:00:34,610 --> 00:00:38,980
OK a constructor with only one argument as you can see here.

10
00:00:39,210 --> 00:00:42,080
And a constructor with two arguments.

11
00:00:42,090 --> 00:00:42,560
OK.

12
00:00:42,600 --> 00:00:49,800
When you create your own classes you can define as many constructors as you'll need to implement the

13
00:00:49,800 --> 00:00:51,450
behavior of the class.

14
00:00:51,450 --> 00:00:58,890
No two constructors in a class can have the same number and type of arguments because this is the only

15
00:00:58,890 --> 00:01:02,860
way constructivists are differentiated from each other.

16
00:01:02,960 --> 00:01:03,570
OK.

17
00:01:03,930 --> 00:01:10,230
As I actually showed you in the previous tutorials that your constructors cannot have the same number

18
00:01:10,290 --> 00:01:11,730
and type of arguments.

19
00:01:11,760 --> 00:01:12,600
OK.

20
00:01:12,900 --> 00:01:18,710
Because that is the only way constructors are differentiated from each other.

21
00:01:18,870 --> 00:01:27,060
If a class defines no constructor is a constructor with no arguments is called by default then an object

22
00:01:27,240 --> 00:01:28,880
of the class is created.

23
00:01:28,950 --> 00:01:36,090
So now that you are familiar with Java programming language you may ask yourself that whether the new

24
00:01:36,210 --> 00:01:43,200
operator here this new operator here this new keyboard has an opposite that destroys an object when

25
00:01:43,200 --> 00:01:44,740
it is no longer needed.

26
00:01:44,940 --> 00:01:49,400
Memory management in Java is dynamic and automatic.

27
00:01:49,680 --> 00:01:57,210
When you create a new object Java automatically allocates the proper amount of memory for that object.

28
00:01:57,210 --> 00:02:02,170
You don't have to allocate any memory for objects explicitly.

29
00:02:02,250 --> 00:02:06,730
The Java virtual machine or JVM does that job for you.

30
00:02:06,870 --> 00:02:10,780
OK so that's why Java is so easy and powerful.

31
00:02:10,790 --> 00:02:14,060
OK because Java memory management is automatic.

32
00:02:14,160 --> 00:02:20,730
You don't need to deallocate the memory an object uses when you you're finished using it.

33
00:02:20,730 --> 00:02:26,820
Under most circumstances when you are finished with an object when you are finished with an object you

34
00:02:26,820 --> 00:02:34,280
have created Jova can determine that the object no longer has any life references to it.

35
00:02:34,320 --> 00:02:39,300
OK in other words the object isn't assigned to any value.

36
00:02:39,300 --> 00:02:49,410
Bell is still in use or stored in as it program runs the JVM periodically looks for unused objects and

37
00:02:49,470 --> 00:02:53,470
reclaims the memory that those objects are using.

38
00:02:53,700 --> 00:02:57,840
This process is called Dynamic garbage collection.

39
00:02:57,840 --> 00:03:04,650
You don't have to explicitly free the memory taken up by an object you just have to make sure that you

40
00:03:04,650 --> 00:03:09,040
are not still holding onto an object you want to get rid of.

41
00:03:09,060 --> 00:03:10,890
OK so this is odd.

42
00:03:11,010 --> 00:03:16,800
This is one of the most powerful feature of the Java programming language.

43
00:03:16,820 --> 00:03:24,760
Ok so I think that's enough for this tutorial and indeed this tutorial will going to create our first

44
00:03:24,850 --> 00:03:26,820
Android application.

45
00:03:27,010 --> 00:03:32,290
So if you have any questions please post the discussion in the course and then I'll do my best to answer

46
00:03:32,290 --> 00:03:33,510
your questions.

47
00:03:33,760 --> 00:03:35,640
And thank you very much for watching.

48
00:03:35,800 --> 00:03:37,700
I'll see you in the next tutorial.

