Not understand collage starting at a more in-depth level and below that it is the first stage in the 2
lifetime of that type. 3
And here is the illustration of the class voting process. 4
When it is accessed be a class or an interface. 5
The classloader objects if the corresponding class object is already on the heap if it is on the heap 6
. 7
It pre-concert class object. 8
Otherwise it means that the pipe is accessed for the very first time. 9
So the coroner tries to look kid the corresponding dot class file using something called a zip here 10
in delegation moortel which we will discuss next. 11
If the doctor find his phone then the classloader loads the corresponding byte Goertz uncreate to a 12
class object undercuts it. 13
And this class object will be stored on the heap for future use. 14
If the Dartmouth's phone is not phone then an exception called class not one exception is thrown. 15
If you recall dishcloths voting process was demonstrative and a clips to Grolier were discussing eclipse 16
debugger and through it also look at it once again in a demo that we will soon do for Dumont's strict 17
in one lifetime of type not a look at board the beat and delegation mortel is which comes into play 18
when a pipe is accessed for the very first time. 19
As you can see here Jawa has multiple clusters each noting Klaas's Krim different repositories on the 20
top. 21
We have the bootstrapped Wastwater which is also referred to as primordial classloader underclothes 22
. 23
All the code just wipe your eyeglasses on this would include the odd Donjon file in the GEORGIS slash 24
lib directory. 25
On this crossborder is implemented as part of the JVM SAYS. 26
Next we have something called the extension classloader which is responsible for the learning process 27
from the standard Java extension abs which are in the GRC slash lib slash Yixin directory. 28
So much that it was accurate. 29
Next we have application or System class order which your application classes from the class bought 30
. 31
So these are regular classes that we don't post right on below application classloader we have user 32
defined clusters. 33
That is their custom cross borders created by a regular doper's under used to load classes from nonstandard 34
user defined sources like and corrupted files databases and so on. 35
These murders are done in Java on Dexter an abstract Glass called classloader which is from the Gelada 36
package. 37
So user defined Glosson roaders are compiled unordered just like any other object in general most developers 38
may never create any custom crossroads object. 39
Typically they are done in certain kinds of advanced software like in the case of web servers like Tomcat 40
. 41
You can see that these cross borders are connected via a parent child relationship and that is every 42
classloader except the top one has appeared on the parent delegation more it for locating a class file 43
comes from this relationship. 44
No when in particular classloader hastily wrote it classify it first console's its period. 45
That is it delegates the search irresponsibility brute spirit and that bit it in turn concerns its own 46
period and the process continues until the bootstrap cost is reached. 47
If the boozed up müssen order does not find a class in its repository then its child which is the extension 48
classloader Kreiss Christ defined in its own repository. 49
This is where the counter goes downwards under the crossborder that initiated the search. 50
So just in its own depositary. 51
But if the cross file is found somewhere in between then the corresponding byte Goertz will be loaded 52
into memory. 53
No the reason why we have this bit in delegation's search model is because JVM considers that repositories 54
at the top as more trustworthy compared to the once at lower levels. 55
That is bootstrapped last word is repository is considered more trustworthy than extension's glass Lauder's 56
repository that just consider more trustworthy than application cluster does depositary. 57
If the concern is found in that trustworthy repository then JVM does not perform stringent security 58
checks and the verification step in their thinking stage. 59
Otherwise JVM performs a strict security checks for instance of the file is found by the application 60
Krasnodar then the bytecode verify or performs all kinds of checks as repositories not considered trustworthy 61
conduct would not be the case with a cordial IP questions that are considered most trustworthy. 62
So we looked at the paid interrogation model which kicks in when it classes access for the first time 63
. 64
So the next thing is in Vought instances a classes accessed unhandsome loaded for very fast classes 65
loaded when an instance of it is created via the new operator. 66
It isn't ordered one off its document that is accessed and it is also loaded when one of its toxic fuses 67
accessed either reading a value or assigning some value to it. 68
Note that accessing compile time constants will not blow declasse and that's because they are compile 69
time constants. 70
That is their values are known at compile time itself and hence they're copied the word they are used 71
. 72
So if a different process is using it then the corresponding field value will be copied into that dot 73
CROSSFIRE. 74
So there's no point loading the class here. 75
And this would've been a monster demonstrated in the demo that we will soon do in a couple of lessons 76
from now. 77
So as long as we are accessing a field that is not a compile time constant then the corresponding class 78
will be ordered classes ordered if its subclasses are ordered. 79
OK so just keep that in mind. 80
And the class is obviously loaded. 81
If it does run from the command line finally it can also be loaded with reflection on we were discuss 82
reflection and few lessons from now. 83
So those are the instances when a class is loaded for the very first time. 84
Now when it comes to an interface except for the Fuster isn't an interface Voula also be loaded in all 85
other instances with regards to the first reason. 86
We know that we cannot instantiate an interface just know of second instance is possible only from July 87
8 onwards. 88
As part of Java aid interfaces cannot house start it matters on for the same reason an interface can 89
be run from the command line also. 90
And that's possible only from July 8 onwards and that's because the main method is this tactic method 91
. 92
So the interface can have a main method. 93
Finally an interface can also be loaded when a sub interface is loaded. 94
In addition to suppress the class it can only be a subclass as it cannot have a sub interface that is 95
an interface cannot ekster Nicholas. 96
No let's discuss a little bit about a class object which is the output of the class throating process 97
unladen we would have more effort while coding reflection the most important thing to know is that all 98
the objects that we create from a particular class is always done using the class object of ductless 99
and that's how GBM creates objects for us. 100
It's not just class an interface that would have a class object. 101
Even all primitive types. 102
The void keyword on our base would have a class object later when doing a dim off reflection B would 103
see hope class object also Madieu will be useful on with regards to our is. 104
Note that all R is of same dimension n same type. 105
Have the same class object lenth of the R It does not play any at all here. 106
For example an entry of entry has the same class object as and array of Lent hundred since both out 107
of pipe in unbought have the same number of dimensions. 108
Gas object basically contains Medine for mission aboard the class and we can get that information using 109
its methods on some of them are shown here. 110
The first method name would simply written the name of the class get superclass method worked on the 111
superclass of the current class so that it can bite is the class object of the code I'm closer to possess 112
either. 113
Object class or an interface or a primitive type or void. 114
Then null is returned as they don't have a superclass. 115
If this class object represents an array class then the class object representing the object lost is 116
returned. 117
Next is the user interface muttered under detainments of the current class object represents an interface 118
not Nexus get interface estimate. 119
Underachieve does all the interfaces implemented by the current class and get frustrated a third rate 120
and that classloader that loaded this class under-exposed more interesting methods. 121
In the dim off reflection I think you can check out all the methods in a game. 122
Once we do that Demel so up with the class throwing process. 123
We looked at the class learning process itself. 124
We looked at class loaders and also the bean in delegation model which happens when a class has access 125
for the very first time. 126
And we also looked that instances when a type is access for the very first time and finally we looked 127
at the class object itself. 128
Thank you