File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class loader" Watch "class loader" New topic
Author

class loader

hemant nayak
Greenhorn

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
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

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