File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes What is class class... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "What is class class..." Watch "What is class class..." New topic

What is class class...

kashif hameed

Joined: Jun 15, 2003
Posts: 15
Dear grat java fellows,I have a problum.What is class class ,I think a polite person in which must be explain thsi!
Kashif Hameed!
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
The Class class (did you hear an echo?) is mainly used for the java reflection API. If you know the Class of an object you can learn practically everything about its class: fields, methods, constructors, etc. It also has a couple of handy methods, getResource() and getResourceAsStream(), which return URL and InputStream respectively. Those are very usefull when you have a resource in the same jar file as the object of the particular Class. You will no doubt eventually see code like:

That static method causes the ClassLoader to dynamically load the class com.mywww.DBDriver, provided of course it can locate it.

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
I agree. Here's the link:
subject: What is class class...
It's not a secret anymore!