jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes class loader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class loader" Watch "class loader" New topic

class loader

hemant nayak

Joined: May 02, 2006
Posts: 1
hi all, i am a bit confused about class loader and its function. i think class loader loads java class for execution(hope i am right).But then what is a class loader ---- is it comes with uderlying operating system or it comes with java virtual machine.Thank u....
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199


Welcome to JavaRanch!

A class loader is any Java class that extends java.lang.ClassLoader. The job of a class loader is to find the data that defines a class -- i.e., read it out of a *.jar or *.class file -- and call a special method in java.lang.ClassLoader which turns that data into a Class in the JVM. That special method is a native method -- one whose code is actually written in C or assembly language. If you have some interesting new way to store class file data, it's pretty easy to write your own class loader.

A JVM has to come with a special "bootstrap" class loader so that it can load the very first class files. This primordial class loader is written all in C or assembly, and it calls that native method's C implementation directly.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link: http://aspose.com/file-tools
subject: class loader
It's not a secret anymore!