Java Standard Libraries
Java has a large number of libraries that are included with the JDK. These libraries are known as the Java Standard Libraries. They are divided into packages and classes. The Java Standard Libraries are organized into packages. Each package contains a set of related classes. The Java Standard Libraries are grouped into several packages. Some of the most important packages are:
-
java.lang
- Contains classes that are fundamental to the design of the Java programming language. The most important classes in this package areObject
,String
,StringBuffer
,System
,Thread
,Math
,Integer
,Float
,Double
,Boolean
, andCharacter
. -
java.util
- Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array). -
java.io
- Contains classes for input and output operations. -
java.net
- Contains classes for networking. -
java.awt
- Contains classes for creating user interfaces and for painting graphics and images. -
javax.swing
- Contains classes for creating user interfaces. -
java.applet
- Contains classes for creating applets. -
java.sql
- Contains classes for accessing and processing data stored in a database. -
java.rmi
- Contains classes for creating remote method invocation objects. -
java.security
- Contains classes for implementing security. -
java.text
- Contains classes for formatting and parsing numbers, dates, and text. -
java.util.regex
- Contains classes for matching patterns in strings. -
java.util.concurrent
- Contains classes for concurrent programming. -
java.util.stream
- Contains classes for processing sequences of elements. -
java.nio
- Contains classes for performing input and output operations. -
java.time
- Contains classes for working with dates and times. -
java.lang.reflect
- Contains classes for obtaining information about classes and objects. -
java.lang.annotation
- Contains classes for creating and processing annotations. -
java.lang.instrument
- Contains classes for monitoring and controlling the JVM. -
java.lang.management
- Contains classes for managing and monitoring the JVM. -
java.lang.invoke
- Contains classes for implementing dynamic method invocation. -
java.lang.module
- Contains classes for working with modules. -
java.lang.ref
- Contains classes for implementing reference objects.
java.lang
Package
The java.lang
package is automatically imported into every Java program. This package contains classes that are fundamental to the design of the Java programming language. Some of the most important classes in this package are:
Object
- The root class of the JavaString
- Represents a sequence of charactersStringBuffer
- Represents a mutable sequence of charactersSystem
- Provides access to system resourcesThread
- Represents a thread of executionMath
- Provides mathematical functionsInteger
- Represents an integerFloat
- Represents a floating-point numberDouble
- Represents a double-precision floating-point numberBoolean
- Represents a boolean valueCharacter
- Represents a character
java.util
Package
The java.util
package contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes. Some of the most important classes in this package are:
ArrayList
- Implements a dynamic arrayLinkedList
- Implements a linked listHashMap
- Implements a hash tableHashSet
- Implements a hash setHashtable
- Implements a hash tableTreeMap
- Implements a red-black tree
java.io
Package
The java.io
package contains classes for input and output operations. Some of the most important classes in this package are:
File
- Represents a file or directoryFileInputStream
- Reads data from a fileFileOutputStream
- Writes data to a fileBufferedReader
- Reads text from a character-input streamBufferedWriter
- Writes text to a character-output streamDataInputStream
- Reads primitive data types from an input streamDataOutputStream
- Writes primitive data types to an output stream
java.net
Package
The java.net
package contains classes for networking. Some of the most important classes in this package are:
URL
- Represents a Uniform Resource LocatorURLConnection
- Represents a connection to a URLSocket
- Represents a socketServerSocket
- Represents a server socket
java.awt
Package
The java.awt
package contains classes for creating user interfaces and for painting graphics and images. Some of the most important classes in this package are:
Frame
- Represents a windowPanel
- Represents a container for componentsButton
- Represents a buttonLabel
- Represents a labelTextField
- Represents a text fieldTextArea
- Represents a text areaCanvas
- Represents a canvas for drawing graphics
javax.swing
Package
The javax.swing
package contains classes for creating user interfaces. Some of the most important classes in this package are:
JFrame
- Represents a windowJPanel
- Represents a container for componentsJButton
- Represents a buttonJLabel
- Represents a labelJTextField
- Represents a text fieldJTextArea
- Represents a text areaJCanvas
- Represents a canvas for drawing graphics
java.applet
Package
The java.applet
package contains classes for creating applets. Some of the most important classes in this package are:
Applet
- Represents an appletAppletContext
- Represents the context of an appletAppletStub
- Represents the stub of an applet
java.sql
Package
The java.sql
package contains classes for accessing and processing data stored in a database. Some of the most important classes in this package are:
Connection
- Represents a connection to a databaseStatement
- Represents a SQL statementResultSet
- Represents a result set
java.rmi
Package
The java.rmi
package contains classes for creating remote method invocation objects. Some of the most important classes in this package are:
Remote
- Represents a remote objectRemoteException
- Represents a remote exception
java.security
Package
The java.security
package contains classes for implementing security. Some of the most important classes in this package are:
Key
- Represents a cryptographic keyKeyPair
- Represents a key pairKeyPairGenerator
- Generates key pairsKeyStore
- Manages keys and certificatesMessageDigest
- Computes a message digestSignature
- Signs and verifies data
java.text
Package
The java.text
package contains classes for formatting and parsing numbers, dates, and text. Some of the most important classes in this package are:
DecimalFormat
- Formats decimal numbersSimpleDateFormat
- Formats dates and timesMessageFormat
- Formats messages
java.util.regex
Package
The java.util.regex
package contains classes for matching patterns in strings. Some of the most important classes in this package are:
Pattern
- Represents a compiled regular expressionMatcher
- Matches a pattern against a string
java.util.concurrent
Package
The java.util.concurrent
package contains classes for concurrent programming. Some of the most important classes in this package are:
Executor
- Executes tasksExecutorService
- Manages a pool of threadsFuture
- Represents the result of an asynchronous computationCallable
- Represents a task that returns a resultRunnableFuture
- Represents a runnable future
java.util.stream
Package
The java.util.stream
package contains classes for processing sequences of elements. Some of the most important classes in this package are:
Stream
- Represents a sequence of elementsCollector
- Collects elements into a containerSupplier
- Supplies elementsConsumer
- Consumes elementsFunction
- Transforms elementsPredicate
- Tests elements
java.nio
Package
The java.nio
package contains classes for performing input and output operations. Some of the most important classes in this package are:
ByteBuffer
- Represents a byte bufferCharBuffer
- Represents a character bufferShortBuffer
- Represents a short buffer
java.time
Package
The java.time
package contains classes for working with dates and times. Some of the most important classes in this package are:
LocalDate
- Represents a dateLocalTime
- Represents a timeLocalDateTime
- Represents a date and timeZonedDateTime
- Represents a date and time with a time zoneDuration
- Represents a durationPeriod
- Represents a period
java.lang.reflect
Package
The java.lang.reflect
package contains classes for obtaining information about classes and objects. Some of the most important classes in this package are:
Class
- Represents a classField
- Represents a fieldMethod
- Represents a methodConstructor
- Represents a constructor
java.lang.annotation
Package
The java.lang.annotation
package contains classes for creating and processing annotations. Some of the most important classes in this package are:
Annotation
- Represents an annotationAnnotationType
- Represents an annotation type
java.lang.instrument
Package
The java.lang.instrument
package contains classes for monitoring and controlling the JVM. Some of the most important classes in this package are:
Instrumentation
- Provides services for monitoring and controlling the JVM
java.lang.management
Package
The java.lang.management
package contains classes for managing and monitoring the JVM. Some of the most important classes in this package are:
MemoryMXBean
- Represents the memory management of the JVMThreadMXBean
- Represents the thread management of the JVM
java.lang.invoke
Package
The java.lang.invoke
package contains classes for implementing dynamic method invocation. Some of the most important classes in this package are:
MethodHandle
- Represents a method handleMethodType
- Represents a method type
java.lang.module
Package
The java.lang.module
package contains classes for working with modules. Some of the most important classes in this package are:
Module
- Represents a moduleModuleLayer
- Represents a layer of modules
java.lang.ref
Package
The java.lang.ref
package contains classes for implementing reference objects. Some of the most important classes in this package are:
Reference
- Represents a reference objectSoftReference
- Represents a soft reference object
Conclusion
The Java Standard Libraries are a set of libraries that are included with the JDK. They are organized into packages and classes. The Java Standard Libraries are grouped into several packages, each containing a set of related classes. Some of the most important packages are java.lang
, java.util
, java.io
, java.net
, java.awt
, javax.swing
, java.applet
, java.sql
, java.rmi
, java.security
, java.text
, java.util.regex
, java.util.concurrent
, java.util.stream
, java.nio
, java.time
, java.lang.reflect
, java.lang.annotation
, java.lang.instrument
, java.lang.management
, java.lang.invoke
, java.lang.module
, and java.lang.ref
. These libraries provide a wide range of functionality that can be used to develop Java applications.