Why is it advisable to load the Java Runtime classes and API classes using the default system class loader in Java? What happens if we load them using our custom class loader?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One of the criterias for
instanceofto be true, is that the two classes must be loaded by the same classloader. This goes for class casting too.This would mean that instances of e.g.
Stringcreated by your class loader would not be compatible with theStringcreated by the system class loader. Are not instances of and cannot be cast to.You probably do not want that.