This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 24183


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]
jQuery in Action, 2nd edition
subject: class loader
Similar Threads
understand class loader
Why do we have the option of passing class loader to get resource bundle
class reloader question
Custom Class oader
finding location of jar files