Java api and packages

All Packages

This package comprises the interfaces and classes used to define the signing mechanism used by the jarsigner tool.

This is the core package of the Java Debug Interface (JDI), it defines mirrors for values, types, and the target VirtualMachine itself — as well bootstrapping facilities.

This package defines connections between the virtual machine using the JDI and the target virtual machine.

This package comprises the interfaces and classes used to develop new TransportService implementations.

This package contains the JDK’s extension to the standard implementation of the java.lang.management API and also defines the management interface for some other components of the platform.

Provides a pluggable service provider interface, which allows the HTTP server implementation to be replaced with other implementations.

Only developers who are defining new attach providers should need to make direct use of this package.

Provides the classes necessary to create an applet and the classes an applet uses to communicate with its applet context.

Drag and Drop is a direct manipulation gesture found in many Graphical User Interface systems that provides a mechanism to transfer information between two entities logically associated with presentation elements in the GUI.

Provides the Java 2D classes for defining and performing operations on objects related to two-dimensional geometry.

Provides interfaces that enable the development of input methods that can be used with any Java runtime environment.

Classes and interfaces to represent nominal descriptors for run-time entities such as classes or method handles, and classfile entities such as constant pool entries or invokedynamic call sites.

Provides services that allow Java programming language agents to instrument programs running on the JVM.

The java.lang.invoke package provides low-level primitives for interacting with the Java Virtual Machine.

Provides the management interfaces for monitoring and management of the Java virtual machine and other components in the Java runtime.

Classes to support module descriptors and creating configurations of modules by means of resolution and service binding.

Provides reference-object classes, which support a limited degree of interaction with the garbage collector.

Provides classes for performing arbitrary-precision integer arithmetic ( BigInteger ) and arbitrary-precision decimal arithmetic ( BigDecimal ).

Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.

Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.

Provides classes and interfaces for parsing and managing certificates, certificate revocation lists (CRLs), and certification paths.

Provides interfaces for generating RSA (Rivest, Shamir and Adleman AsymmetricCipher algorithm) keys as defined in the RSA Laboratory Technical Note PKCS#1, and DSA (Digital Signature Algorithm) keys as defined in NIST’s FIPS-186.

Provides the API for accessing and processing data stored in a data source (usually a relational database) using the Java programming language.

Читайте также:  Wordpress минимальная версия php

Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.

Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.

Interfaces and classes providing a framework for locking and waiting for conditions that is distinct from built-in synchronization and monitors.

Provides classes for reading and writing the JAR (Java ARchive) file format, which is based on the standard ZIP file format with an optional manifest file.

This package allows applications to store and retrieve user and system preference and configuration data.

This package contains classes and interfaces that support a generic API for random number generation.

Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.

Defines a contract between user-interface components and an assistive technology that provides access to those components.

Facilities for declaring annotation processors and for allowing annotation processors to communicate with an annotation processing tool environment.

A package of the Java Image I/O API dealing with synchronous notification of events during the reading and writing of images.

A package of the Java Image I/O API containing the plug-in interfaces for readers, writers, transcoders, and streams, and a runtime registry.

Types and hierarchies of packages comprising a Java language model, a model of the declarations and types of the Java programming language.

The RMI connector is a connector for the JMX Remote API that uses RMI to transmit client requests to a remote MBean server.

Provides the means for dynamically plugging in support for accessing naming and directory services through the javax.naming and related packages.

Provides classes and interfaces that describe the types of Java Print Service attributes and how they can be collected into attribute sets.

Provides implementations of RMIClientSocketFactory and RMIServerSocketFactory over the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.

The scripting API consists of interfaces and classes that define Java Scripting Engines and provides a framework for their use in Java applications.

This package provides the classes necessary for services to interact with applications in order to retrieve information (authentication data including usernames or passwords, for example) or to display information (error and warning messages, for example).

This package contains the classes that should be used to store X500 Principal and X500 Private Credentials in a Subject.

Provides interfaces and classes for I/O, sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data.

Supplies interfaces for service providers to implement when offering new MIDI devices, MIDI file readers and writers, or sound bank readers.

Supplies abstract classes for service providers to subclass when offering new audio devices, sound file readers and writers, or audio format converters.

Provides the API for server side data source access and processing from the Java programming language.

Provides utility classes to allow serializable mappings between SQL types and data types in the Java programming language.

Читайте также:  Как присвоить переменной строку питон

The standard classes and interfaces that a third party vendor has to use in its implementation of a synchronization provider.

Provides a set of «lightweight» (all-Java language) components that, to the maximum degree possible, work the same on all platforms.

Provides one interface and many abstract classes that Swing uses to provide its pluggable look-and-feel capabilities.

Provides user interface objects built according to the Java look and feel (once codenamed Metal), which is the default look and feel.

Provides the API that defines the contract between the transaction manager and the resource manager, which allows the transaction manager to enlist and delist resource objects (supplied by the resource manager driver) in JTA transactions.

Provides the classes for processing XML documents with a SAX (Simple API for XML) parser or a DOM (Document Object Model) Document builder.

Defines the generic APIs for processing transformation instructions, and performing a transformation from source to result.

Provides an object-model neutral API for the evaluation of XPath expressions and access to the evaluation environment.

Contains interfaces and classes needed by language runtimes to implement their own language-specific object models and type conversions.

Contains classes that make it more convenient for language runtimes to implement their own language-specific object models and type conversions by providing basic implementations of some classes as well as various utilities.

Contains classes that make using Dynalink more convenient by providing basic implementations of some classes as well as various utilities.

The Doclet API provides an environment which, in conjunction with the Language Model API and Compiler Tree API, allows clients to inspect the source-level structures of programs and libraries, including API comments embedded in the source.

Provides interfaces for creating tools, such as a Read-Eval-Print Loop (REPL), which interactively evaluate «snippets» of Java programming language code.

This package contains classes to control and monitor Flight Recorder over Java Management Extensions (JMX).

This package presents a framework that allows application developers to make use of security services like authentication, data integrity and data confidentiality from a variety of underlying security mechanisms like Kerberos, using a unified API.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Java Packages

A package in Java is used to group related classes. Think of it as a folder in a file directory. We use packages to avoid name conflicts, and to write a better maintainable code. Packages are divided into two categories:

  • Built-in Packages (packages from the Java API)
  • User-defined Packages (create your own packages)
Читайте также:  Null argument exception java

Built-in Packages

The Java API is a library of prewritten classes, that are free to use, included in the Java Development Environment.

The library contains components for managing input, database programming, and much much more. The complete list can be found at Oracles website: https://docs.oracle.com/javase/8/docs/api/.

The library is divided into packages and classes. Meaning you can either import a single class (along with its methods and attributes), or a whole package that contain all the classes that belong to the specified package.

To use a class or a package from the library, you need to use the import keyword:

Syntax

import package.name.Class; // Import a single class import package.name.*; // Import the whole package 

Import a Class

If you find a class you want to use, for example, the Scanner class, which is used to get user input, write the following code:

Example

In the example above, java.util is a package, while Scanner is a class of the java.util package.

To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation. In our example, we will use the nextLine() method, which is used to read a complete line:

Example

Using the Scanner class to get user input:

import java.util.Scanner; class MyClass < public static void main(String[] args) < Scanner myObj = new Scanner(System.in); System.out.println("Enter username"); String userName = myObj.nextLine(); System.out.println("Username is: " + userName); >> 

Import a Package

There are many packages to choose from. In the previous example, we used the Scanner class from the java.util package. This package also contains date and time facilities, random-number generator and other utility classes.

To import a whole package, end the sentence with an asterisk sign ( * ). The following example will import ALL the classes in the java.util package:

Example

User-defined Packages

To create your own package, you need to understand that Java uses a file system directory to store them. Just like folders on your computer:

Example

└── root └── mypack └── MyPackageClass.java

To create a package, use the package keyword:

MyPackageClass.java

package mypack; class MyPackageClass < public static void main(String[] args) < System.out.println("This is my package!"); >> 

Save the file as MyPackageClass.java, and compile it:

This forces the compiler to create the «mypack» package.

The -d keyword specifies the destination for where to save the class file. You can use any directory name, like c:/user (windows), or, if you want to keep the package within the same directory, you can use the dot sign » . «, like in the example above.

Note: The package name should be written in lower case to avoid conflict with class names.

When we compiled the package in the example above, a new folder was created, called «mypack».

To run the MyPackageClass.java file, write the following:

Источник

Оцените статью