tags:

views:

99

answers:

3

Hi,

What is a Class library in Java? Is it a collection of classes with in a package, or it is a package that has collection of classes?

I'm bit confused. ^_^

+5  A: 

It's a collection of classes, usually bundled up in a jar file. All the classes may be in the same Java package, but they don't have to be. A class library in a jar file may also contain resources and meta-data that it needs (e.g. string translations, driver information for other frameworks etc).

Jon Skeet
+1  A: 

Yes, class libraries are just sets of classes in a package.

They could be stored in a folder but mostly they are distributed in JARs (Java ARchives), which are just zipped up class files.

Lenni
+1  A: 

The JavaTM Archive (JAR) file format enables you to bundle multiple files into a single archive file. Typically a JAR file contains the class files and auxiliary resources associated with applets and applications.

You can get more information from this link

Firstthumb