List of Useful Core Java Packages

In this article, we will discuss useful core Java packages that can be used in almost all Java applications. I took JDK 10 release as a reference to list important core java packages. I have been using these core Java packages in my day to day project work so I hope you guys find it useful.

List of Useful Core Java Packages

1. Java Lang Package

java.lang package provides classes that are fundamental to the design of the Java programming language

2. Java Util Package

java.util package 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).

3. Java Time Package

Java 8 has introduced a new Date and Time API under java.time package. The java.time package provides API for dates, times, instants, and durations.

4. Java IO Package

Java.io package provides classes for system input and output through data streams, serialization, and the file system.

5. Java net Package

The package java.net contains classes and interfaces that provide a powerful infrastructure for networking in Java. The java.net package can be roughly divided into two sections: a low-level API and a high-level API. Low-level API has classes like InetAddress whereas high-level API has classes like URL, URI, URLConnection, and HttpURLConnection.

6. Java NIO Package

The java.nio.file package and its related package, java.nio.file.attribute, provide comprehensive support for file I/O and for accessing the default file system.
Java NIO (New IO) is an alternative IO API for Java (from Java 1.4), meaning alternative to the standard Java IO API’s. Java NIO offers a different way of working with IO than the standard IO API’s.

7. Java SQL Package 

The java.sql package provides the API for accessing and processing data stored in a data source (usually a relational database) using the Java programming language. This API includes a framework whereby different drivers can be installed dynamically to access different data sources. Although the JDBC API is mainly geared to passing SQL statements to a database, it provides for reading and writing data from any data source with a tabular format. 

8. Javax XML.* Package

Javax.xml.* packages provide classes allowing the processing and communication of XML documents.

9. JavaFX.* Package

JavaFX is a GUI toolkit for Java (GUI is short for Graphical User Interface). JavaFX makes it easier to create desktop applications and games in Java.

Below are briefly overview of its related package:
  • javafx.base - Defines the base APIs for the JavaFX UI toolkit, including APIs for bindings, properties, collections, and events.
  • javafx.controls - Defines the UI controls, charts, and skins that are available for the JavaFX UI toolkit.
  • javafx.fxml- Defines the FXML APIs for the JavaFX UI toolkit.
  • javafx.graphics - Defines the core scenegraph APIs for the JavaFX UI toolkit (such as layout containers, application lifecycle, shapes, transformations, canvas, input, painting, image handling, and effects), as well as APIs for animation, css, concurrency, geometry, printing, and windowing.
  • javafx.media - Defines APIs for playback of media and audio content, as part of the JavaFX UI toolkit, including MediaView and MediaPlayer.
  • javafx.swing - Defines APIs for the JavaFX / Swing interop support included with the JavaFX UI toolkit, including SwingNode (for embedding Swing inside a JavaFX application) and JFXPanel (for embedding JavaFX inside a Swing application).
  • javafx.web - Defines APIs for the WebView functionality contained within the JavaFX UI toolkit.
Javadoc at https://docs.oracle.com/javase/10/docs/api/overview-summary.html.

10. Javax swing Package

The javax.swing package provides classes for java swing API such as JButton, JTextField, JTextArea, JRadioButton, JCheckbox, JMenu, JColorChooser etc.

11. Java math Package

java.math package provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).

12. Java Security Package

The java.security package provides the classes and interfaces for the security framework.

13. Java text Package

The java.text package provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.

14. java.util.logging Package

This package provides the classes and interfaces of the Java platform's core logging facilities. The central goal of the logging APIs is to support maintaining and servicing software at customer sites.

References


Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours


Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course

Comments