1

I hear the term of standard libraries a lot in Java. Is a library just a collection of packages, which is indirectly a collection of classes. So would that make a library a collection of classes? What makes a library different from a standard library?

I do see this answer on this link below where they say packages and standard library are the same thing. Where can I find a list of the Java Standard libraries?

But this link here: https://docs.oracle.com/javase/tutorial/java/concepts/package.html tells me that packages and libraries are a different thing. So I guess my question now also is where can I find this standard library, and are there multiple standard libraries or are there just one?

  • You should check out this Q&A: [Class vs package vs module vs component vs container vs service vs platform in Java world](https://stackoverflow.com/questions/13157377). The question itself includes many links. You should also look at its linked/related questions (right side of the page). – Slaw Aug 13 '20 at 06:21

2 Answers2

0

It's really great that you're trying to understand the specifics of the language! From my understanding:

  • The standard library holds the individual packages provided by Oracle -- so your understanding about the standard library is correct, there is only 1.

  • You, as a developer, can also create your own Java library with packages. This is what leads to multiple 'libraries'.

KidCoder
  • 363
  • 5
  • 18
0

The word package has a lot meanings in Java programming.

It can mean:
The folder where the class file "MyClass.java" is stored.
or
The jar file where the library is store - which is packaged as a jar file.

Here is a list of standard libraries/packages in Java 8: https://docs.oracle.com/javase/8/docs/api/overview-summary.html

Read more about packages here: What's the difference between "package" and "module"?

DigitShifter
  • 801
  • 5
  • 12