Java Platform, Standard Edition
Encyclopedia
Java Platform, Standard Edition or Java SE is a widely used platform
Platform (computing)
A computing platform includes some sort of hardware architecture and a software framework , where the combination allows software, particularly application software, to run...

 for programming in the Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 language. It is the Java Platform used to deploy portable
Porting
In computer science, porting is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed...

 applications
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 for general use. In practical terms, Java SE consists of a virtual machine, which must be used to run Java programs, together with a set of libraries (or "packages") needed to allow the use of file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

s, network
Computer network
A computer network, often simply referred to as a network, is a collection of hardware components and computers interconnected by communication channels that allow sharing of resources and information....

s, graphical interfaces
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

, and so on, from within those programs.

Nomenclature, standards and specifications

Java SE was known as Java 2 Platform, Standard Edition or J2SE from version 1.2 until version 1.5. The "SE" is used to distinguish the base platform from Java EE and Java ME. The "2" was originally intended to emphasize the major changes introduced in version 1.2, but was removed in version 1.6. The naming convention has been changed several times over the Java version history
Java version history
The Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process , which uses Java Specification Requests to propose and...

. Starting with J2SE 1.4 (Merlin), Java SE has been developed under the Java Community Process
Java Community Process
The Java Community Process or JCP, established in 1998, is a formalized process that allows interested parties to get involved in the definition of future versions and features of the Java platform....

. JSR 59 was the umbrella specification for J2SE 1.4 and JSR 176 specified J2SE 5.0 (Tiger). Java SE 6 (Mustang) was released under JSR 270.

Java Platform, Enterprise Edition
Java Platform, Enterprise Edition
Java Platform, Enterprise Edition or Java EE is widely used platform for server programming in the Java programming language. The Java platform differs from the Java Standard Edition Platform in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier...

 is a related specification which includes all of the classes
Class (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...

 in Java SE, plus a number which are more useful to programs which run on server
Server (computing)
In the context of client-server architecture, a server is a computer program running to serve the requests of other programs, the "clients". Thus, the "server" performs some computational task on behalf of "clients"...

s as opposed to workstation
Workstation
A workstation is a high-end microcomputer designed for technical or scientific applications. Intended primarily to be used by one person at a time, they are commonly connected to a local area network and run multi-user operating systems...

s. Java Platform, Micro Edition
Java Platform, Micro Edition
Java Platform, Micro Edition, or Java ME, is a Java platform designed for embedded systems . Target devices range from industrial controls to mobile phones and set-top boxes...

 is a related specification intended to provide a certified collection of Java APIs for the development of software for small, resource-constrained devices such as cell phones, PDAs and set-top box
Set-top box
A set-top box or set-top unit is an information appliance device that generally contains a tuner and connects to a television set and an external source of signal, turning the signal into content which is then displayed on the television screen or other display device.-History:Before the...

es.

The Java Runtime Environment (JRE) and Java Development Kit (JDK)
Java Development Kit
The Java Development Kit is an Oracle Corporation product aimed at Java developers. Since the introduction of Java, it has been by far the most widely used Java SDK. On 17 November 2006, Sun announced that it would be released under the GNU General Public License , thus making it free software...

 are the actual files that are downloaded and installed on a computer in order to run or develop java programs, respectively.

java.lang

The Java package
Java package
A Java package is a mechanism for organizing Java classes into namespaces similar to the modules of Modula. Java packages can be stored in compressed files called JAR files, allowing classes to download faster as a group rather than one at a time...

  contains fundamental classes and interfaces
Interface (Java)
An interface in the Java programming language is an abstract type that is used to specify an interface that classes must implement. Interfaces are declared using the interface keyword, and may only contain method signature and constant declarations...

 closely tied to the language and runtime system. This includes the root classes that form the class hierarchy
Class hierarchy
As in taxonomy, the classifications of species, a class hierarchy in computer science is a classification of object types, denoting objects as the instantiations of classes inter-relating the various classes by relationships such as "inherits", "extends", "is an abstraction of", "an interface...

, types tied to the language definition, basic exceptions
Exception handling
Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution....

, math functions, threading
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

, security functions, as well as some information on the underlying native system. This package contains 22 of 32 Error classes provided in JDK 6.

The main classes in java.lang are: – the class that is the root of every class hierarchy. – the base class for enumeration classes
Enumerated type
In computer programming, an enumerated type is a data type consisting of a set of named values called elements, members or enumerators of the type. The enumerator names are usually identifiers that behave as constants in the language...

 (as of J2SE 5.0). – the class that is the root of the Java reflection
Reflection (computer science)
In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior at runtime....

 system. – the class that is the base class of the exception class hierarchy., , and – the base classes for each exception type. – the class that allows operations on threads. – the class for strings
String (computer science)
In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set or alphabet....

 and string literal
String literal
A string literal is the representation of a string value within the source code of a computer program. There are numerous alternate notations for specifying string literals, and the exact notation depends on the individual programming language in question...

s. and – classes for performing string manipulation (StringBuilder as of J2SE 5.0). – the interface that allows generic comparison and ordering of objects (as of J2SE 1.2). – the interface that allows generic iteration using the enhanced for loop (as of J2SE 5.0)., , ,, and – classes that provide "system operations" that manage the dynamic loading of classes, creation of external processes, host environment inquiries such as the time of day, and enforcement of security policies
Security policy
Security policy is a definition of what it means to be secure for a system, organization or other entity. For an organization, it addresses the constraints on behavior of its members as well as constraints imposed on adversaries by mechanisms such as doors, locks, keys and walls...

. and – classes that provide basic math functions such as sine
Sine
In mathematics, the sine function is a function of an angle. In a right triangle, sine gives the ratio of the length of the side opposite to an angle to the length of the hypotenuse.Sine is usually listed first amongst the trigonometric functions....

, cosine, and square root
Square root
In mathematics, a square root of a number x is a number r such that r2 = x, or, in other words, a number r whose square is x...

 (StrictMath as of J2SE 1.3).
  • The primitive wrapper class
    Primitive wrapper class
    A primitive wrapper class in the Java programming language is one of eight classes provided in the package to provide object methods for the eight primitive types. All of the primitive wrapper classes in Java are immutable...

    es that encapsulate primitive type
    Primitive type
    In computer science, primitive data type is either of the following:* a basic type is a data type provided by a programming language as a basic building block...

    s as objects
    Object (computer science)
    In computer science, an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure...

    .
  • The basic exception classes thrown for language-level and other common exceptions.


Classes in java.lang are automatically imported into every source file.

java.lang.ref

The package provides more flexible types of references
Reference (computer science)
In computer science, a reference is a value that enables a program to indirectly access a particular data item, such as a variable or a record, in the computer's memory or in some other storage device. The reference is said to refer to the data item, and accessing those data is called...

 than are otherwise available, permitting limited interaction between the application and the Java Virtual Machine
Java Virtual Machine
A Java virtual machine is a virtual machine capable of executing Java bytecode. It is the code execution component of the Java software platform. Sun Microsystems stated that there are over 4.5 billion JVM-enabled devices.-Overview:...

 (JVM) garbage collector
Garbage collection (computer science)
In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program...

. It is an important package, central enough to the language for the language designers to give it a name that starts with "java.lang", but it is somewhat special-purpose and not used by a lot of developers. This package was added in J2SE 1.2.

Java has an expressive system of references and allows for special behavior for garbage collection. A normal reference in Java is known as a "strong reference." The java.lang.ref package defines three other types of references — soft, weak
Weak reference
In computer programming, a weak reference is a reference that does not protect the referenced object from collection by a garbage collector . An object referenced only by weak references is considered unreachable and so may be collected at any time...

, and phantom references. Each type of reference is designed for a specific use.
  • A can be used to implement a cache
    Cache
    In computer engineering, a cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere...

    . An object that is not reachable by a strong reference (that is, not strongly reachable), but is referenced by a soft reference is called "softly reachable." A softly reachable object may be garbage collected at the discretion of the garbage collector. This generally means that softly reachable objects will only be garbage collected when free memory is low, but again, it is at the discretion of the garbage collector. Semantically, a soft reference means "keep this object when nothing else references it unless the memory is needed."

  • A is used to implement weak maps. An object that is not strongly or softly reachable, but is referenced by a weak reference is called "weakly reachable". A weakly reachable object will be garbage collected during the next collection cycle. This behavior is used in the class . A weak map allows the programmer to put key/value pairs in the map and not worry about the objects taking up memory when the key is no longer reachable anywhere else. Another possible application of weak references is the string intern pool
    String intern pool
    In computer science, string interning is a method of storing only one copy of each distinct string value, which must be immutable. Interning strings makes some string processing tasks more time- or space-efficient at the cost of requiring more time when the string is created or interned...

    . Semantically, a weak reference means "get rid of this object when nothing else references it at the next garbage collection."

  • A is used to reference objects that have been marked for garbage collection and have been finalized
    Finalizer
    In object-oriented programming languages that use garbage collection, a finalizer is a special method that is executed when an object is garbage collected. It is similar in function to a destructor...

    , but have not yet been reclaimed. An object that is not strongly, softly or weakly reachable, but is referenced by a phantom reference is called "phantom reachable." This allows for more flexible cleanup than is possible with the finalization mechanism alone. Semantically, a phantom reference means "this object is no longer needed and has been finalized in preparation for being collected."


Each of these reference types extends the class which provides the method
Method (computer science)
In object-oriented programming, a method is a subroutine associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time...

 to return a strong reference to the referent object (or null if the reference has been cleared or if the reference type is phantom), and the method to clear the reference.

The java.lang.ref also defines the class , which can be used in each of the applications discussed above to keep track of objects that have changed reference type. When a Reference is created it is optionally registered with a reference queue. The application polls the reference queue to get references that have changed reachability state.

java.lang.reflect

Reflection
Reflection (computer science)
In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior at runtime....

 is a constituent of the Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 API which enables Java code to examine and "reflect" upon Java components at runtime and to use the reflected members. Classes in the package, along with java.lang.Class and accommodate applications such as debugger
Debugger
A debugger or debugging tool is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which...

s, interpreters
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

, object inspectors, class browser
Class browser
A class browser is a feature of an integrated development environment that allows the programmer to browse, navigate, or visualize the structure of object-oriented programming code.- History :...

s, and services such as object serialization
Serialization
In computer science, in the context of data storage and transmission, serialization is the process of converting a data structure or object state into a format that can be stored and "resurrected" later in the same or another computer environment...

 and JavaBeans
JavaBeans
JavaBeans are reusable software components for Java. Practically, they are classes written in the Java programming language conforming to a particular convention. They are used to encapsulate many objects into a single object , so that they can be passed around as a single bean object instead of as...

 that need access to either the public members of a target object (based on its runtime class) or the members declared by a given class. This package was added in JDK 1.1.

Reflection is used to instantiate classes and invoke methods using their names, a concept that allows for dynamic programming. Classes, interfaces, methods, fields
Field (computer science)
In computer science, data that has several parts can be divided into fields. Relational databases arrange data as sets of database records, also called rows. Each record consists of several fields; the fields of all records form the columns....

, and constructor
Constructor (computer science)
In object-oriented programming, a constructor in a class is a special type of subroutine called at the creation of an object. It prepares the new object for use, often accepting parameters which the constructor uses to set any member variables required when the object is first created...

s can all be discovered and used at runtime. Reflection is supported by metadata
Metadata
The term metadata is an ambiguous term which is used for two fundamentally different concepts . Although the expression "data about data" is often used, it does not apply to both in the same way. Structural metadata, the design and specification of data structures, cannot be about data, because at...

 that the JVM has about the program.
Techniques

There are two basic techniques involved in reflection:
  • Discovery - this involves taking an object or class and discovering the members, superclasses, implemented interfaces, and then possibly using the discovered elements.
  • Use by name - involves starting with the symbolic name of an element and using the named element.

Discovery

Discovery typically starts with an object and calling the method to get the object's Class. The Class object has several methods for discovering the contents of the class, for example: – returns an array of objects representing all the public methods of the class or interface – returns an array of objects representing all the public constructors of the class – returns an array of objects representing all the public fields of the class or interface – returns an array of Class objects representing all the public classes and interfaces that are members (e.g. inner class
Inner class
In object-oriented programming , an inner class or nested class is a class declared entirely within the body of another class or interface. It is distinguished from a subclass.-Overview:...

es) of the class or interface – return the Class object representing the superclass of the class or interface (null is returned for interfaces) – returns an array of Class objects representing all the interfaces that are implemented by the class or interface
Use by name

The Class object can be obtained either through discovery, by using the class literal (e.g. MyClass.class) or by using the name of the class (e.g. ). With a Class object, member Method, Constructor, or Field objects can be obtained using the symbolic name of the member. For example: – returns the Method object representing the public method with the name "methodName" of the class or interface that accepts the parameters specified by the Class... parameters. – returns the Constructor object representing the public constructor of the class that accepts the parameters specified by the Class... parameters. – returns the Field object representing the public field with the name "fieldName" of the class or interface.

Method, Constructor, and Field objects can be used to dynamically access the represented member of the class. For example: – returns an Object containing the value of the field from the instance of the object passed to get. (If the Field object represents a static field then the Object parameter is ignored and may be null.) – returns an Object containing the result of invoking the method for the instance of the first Object parameter passed to invoke. The remaining Object... parameters are passed to the method. (If the Method object represents a static method then the first Object parameter is ignored and may be null.) – returns the new Object instance from invoking the constructor. The Object... parameters are passed to the constructor. (Note that the parameterless constructor for a class can also be invoked by calling .)
Arrays and proxies

The java.lang.reflect package also provides an class that contains static methods for creating and manipulating array objects, and since J2SE 1.3, a class that supports dynamic creation of proxy classes that implement specified interfaces.

The implementation of a Proxy class is provided by a supplied object that implements the interface. The InvocationHandler's method is called for each method invoked on the proxy object—the first parameter is the proxy object, the second parameter is the Method object representing the method from the interface implemented by the proxy, and the third parameter is the array of parameters passed to the interface method. The invoke method returns an Object result that contains the result returned to the code that called the proxy interface method.

java.io

The package contains classes that support input and output
Input/output
In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world, possibly a human, or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it...

. The classes in the package are primarily stream-oriented; however, a class for random access
Random access
In computer science, random access is the ability to access an element at an arbitrary position in a sequence in equal time, independent of sequence size. The position is arbitrary in the sense that it is unpredictable, thus the use of the term "random" in "random access"...

 files
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

 is also provided. The central classes in the package are and which are abstract base classes for reading from and writing to byte stream
Byte stream
In computer science, a byte stream is a bit stream, in which data bits are grouped into units, called bytes.In computer networking the term octet stream is sometimes used to refer to the same thing; it emphasizes the use of bytes having the length of 8 bits, known as octets.Formally, a byte stream...

s, respectively. The related classes and are abstract base classes for reading from and writing to character
Character (computing)
In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written form of a natural language....

 streams, respectively. The package also has a few miscellaneous classes to support interactions with the host file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

.

Streams

The stream classes follow the decorator pattern
Decorator pattern
In object-oriented programming, the decorator pattern is a design pattern that allows behaviour to be added to an existing object dynamically.-Introduction:...

 by extending the base subclass to add features to the stream classes. Subclasses of the base stream classes are typically named for one of the following attributes:
  • the source/destination of the stream data
  • the type of data written to/read from the stream
  • additional processing or filtering performed on the stream data


The stream subclasses are named using the naming pattern
Pattern
A pattern, from the French patron, is a type of theme of recurring events or objects, sometimes referred to as elements of a set of objects.These elements repeat in a predictable manner...

 XxxStreamType where Xxx is the name describing the feature and StreamType is one of InputStream, OutputStream, Reader, or Writer.

The following table shows the sources/destinations supported directly by the java.io package:
Source/Destination Name Stream types In/Out Classes
byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

array
Array data type
In computer science, an array type is a data type that is meant to describe a collection of elements , each selected by one or more indices that can be computed at run time by the program. Such a collection is usually called an array variable, array value, or simply array...

 (byte[])
ByteArray byte in, out ,
char array (char[]) CharArray char in, out ,
file
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

 
File byte, char in, out , , ,
string
String (computer science)
In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set or alphabet....

 (StringBuffer)
String char in, out ,
thread
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

 (Thread)
Piped byte, char in, out , , ,


Other standard library packages provide stream implementations for other destinations, such as the InputStream returned by the method or the Java EE class.

Data type handling and processing or filtering of stream data is accomplished through stream filters
Filter (software)
A filter is a computer program to process a data stream. Some operating systems such as Unix are rich with filter programs. Even Windows has some simple filters built into its command shell, most of which have significant enhancements relative to the similar filter commands that were available in...

. The filter classes all accept another compatible stream object as a parameter to the constructor and decorate the enclosed stream with additional features. Filters are created by extending one of the base filter classes , , , or .

The Reader and Writer classes are really just byte streams with additional processing performed on the data stream to convert the bytes to characters. They use the default character encoding
Character encoding
A character encoding system consists of a code that pairs each character from a given repertoire with something else, such as a sequence of natural numbers, octets or electrical pulses, in order to facilitate the transmission of data through telecommunication networks or storage of text in...

 for the platform, which as of J2SE 5.0 is represented by the returned by the static method. The class converts an InputStream to a Reader and the class converts an OutputStream to a Writer. Both these classes have constructors that allow the character encoding to use to be specified—if no encoding is specified then the default encoding for the platform is used.

The following table shows the other processes and filters supported directly by the java.io package. All of these classes extend the corresponding Filter class.
Operation Name Stream types In/Out Classes
buffering
Buffer (computer science)
In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device or just before it is sent to an output device...

 
Buffered byte, char in, out , , ,
"push back" last value read Pushback byte, char in ,
read/write primitive type
Primitive type
In computer science, primitive data type is either of the following:* a basic type is a data type provided by a programming language as a basic building block...

s
Data byte in, out ,
object serialization (read/write objects) Object byte in, out ,

Random access

The class supports random access
Random access
In computer science, random access is the ability to access an element at an arbitrary position in a sequence in equal time, independent of sequence size. The position is arbitrary in the sense that it is unpredictable, thus the use of the term "random" in "random access"...

reading and writing of files. The class uses a file pointer that represents a byte-offset within the file for the next read or write operation. The file pointer is moved implicitly by reading or writing and explicitly by calling the or methods. The current position of the file pointer is returned by the method.

File system

The class represents a file
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

 or directory
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

 path
Path (computing)
A path, the general form of a filename or of a directory name, specifies a unique location in a file system. A path points to a file system location by following the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent...

 in a file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

. File objects support the creation, deletion and renaming of files and directories and the manipulation of file attribute
File attribute
A file attribute is metadata that describes or is associated with a computer file. For example, an operating system often keeps track of the date a file was created and last modified, as well as the file's size and extension . File permissions are also kept track of...

s such as read-only and last modified timestamp. File objects that represent directories can be used to get a list of all of the contained files and directories.

The class is a file descriptor
File descriptor
In computer programming, a file descriptor is an abstract indicator for accessing a file. The term is generally used in POSIX operating systems...

 that represents a source or sink (destination) of bytes. Typically this is a file, but can also be a console or network socket. FileDescriptor objects are used to create File streams. They are obtained from File streams and java.net sockets and datagram sockets.

java.nio

In J2SE 1.4, the package (NIO or New I/O) was added to support memory-mapped I/O
Memory-mapped I/O
Memory-mapped I/O and port I/O are two complementary methods of performing input/output between the CPU and peripheral devices in a computer...

, facilitating I/O
Input/output
In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world, possibly a human, or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it...

 operations closer to the underlying hardware with sometimes dramatically better performance. The java.nio package provides support for a number of buffer types. The subpackage provides support for different character encoding
Character encoding
A character encoding system consists of a code that pairs each character from a given repertoire with something else, such as a sequence of natural numbers, octets or electrical pulses, in order to facilitate the transmission of data through telecommunication networks or storage of text in...

s for character data. The subpackage provides support for channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets. The java.nio.channels package also provides support for fine-grained locking of files.

java.math

The package supports multiprecision arithmetic
Arbitrary-precision arithmetic
In computer science, arbitrary-precision arithmetic indicates that calculations are performed on numbers whose digits of precision are limited only by the available memory of the host system. This contrasts with the faster fixed-precision arithmetic found in most ALU hardware, which typically...

 (including modular arithmetic operations) and provides multiprecision prime number generators used for cryptographic key generation. The main classes of the package are:
– provides arbitrary-precision signed decimal numbers. BigDecimal gives the user control over rounding behavior through RoundingMode. – provides arbitrary-precision integers. Operations on BigInteger do not overflow
Arithmetic overflow
The term arithmetic overflow or simply overflow has the following meanings.# In a computer, the condition that occurs when a calculation produces a result that is greater in magnitude than that which a given register or storage location can store or represent.# In a computer, the amount by which a...

 or lose precision. In addition to standard arithmetic operations, it provides modular arithmetic
Modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" after they reach a certain value—the modulus....

, GCD
Greatest common divisor
In mathematics, the greatest common divisor , also known as the greatest common factor , or highest common factor , of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.For example, the GCD of 8 and 12 is 4.This notion can be extended to...

 calculation, primality testing, prime number
Prime number
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the divisors 2...

 generation, bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

 manipulation, and other miscellaneous operations. – encapsulate the context settings which describe certain rules for numerical operators. – an enumeration that provides eight rounding behaviors.

java.net

The package provides special IO routines for networks, allowing HTTP requests, as well as other common transactions.

java.text

The package implements parsing routines for strings and supports various human-readable languages and locale-specific parsing.

java.util

Data structure
Data structure
In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks...

s that aggregate objects are the focus of the package. Included in the package is the Collections API, an organized data structure hierarchy influenced heavily by the design patterns
Design pattern (computer science)
In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that...

 considerations.

java.applet

Created to support Java applet
Java applet
A Java applet is an applet delivered to users in the form of Java bytecode. Java applets can run in a Web browser using a Java Virtual Machine , or in Sun's AppletViewer, a stand-alone tool for testing applets...

 creation, the package allows applications to be downloaded over a network and run within a guarded sandbox. Security restrictions are easily imposed on the sandbox. A developer, for example, may apply a digital signature
Digital signature
A digital signature or digital signature scheme is a mathematical scheme for demonstrating the authenticity of a digital message or document. A valid digital signature gives a recipient reason to believe that the message was created by a known sender, and that it was not altered in transit...

 to an applet, thereby labeling it as safe. Doing so allows the user to grant the applet permission to perform restricted operations (such as accessing the local hard drive), and removes some or all of the sandbox restrictions. Digital certificates are issued by certificate authorities
Certificate authority
In cryptography, a certificate authority, or certification authority, is an entity that issues digital certificates. The digital certificate certifies the ownership of a public key by the named subject of the certificate...

.

java.beans

Included in the package are various classes for developing and manipulating beans, reusable components defined by the JavaBeans architecture
JavaBeans
JavaBeans are reusable software components for Java. Practically, they are classes written in the Java programming language conforming to a particular convention. They are used to encapsulate many objects into a single object , so that they can be passed around as a single bean object instead of as...

. The architecture provides mechanisms for manipulating properties of components and firing events when those properties change.

The APIs in java.beans are intended for use by a bean editing tool, in which beans can be combined, customized and manipulated. One type of bean editor is a GUI
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

 designer in an integrated development environment
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

.

java.awt

The , or Abstract Window Toolkit, provides access to a basic set of GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

 widgets based on the underlying native platform's widget set, the core of the GUI event subsystem, and the interface between the native windowing system and the Java application. It also provides several basic layout manager
Layout manager
Layout managers are software components used in widget toolkits which have the ability to lay out widgets by their relative positions without using distance units. It is often more natural to define component layouts in this manner than to define their position in pixels or common distance units,...

s, a datatransfer package for use with the Clipboard
Clipboard (software)
The clipboard is a software facility that can be used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations...

 and Drag and Drop, the interface to input device
Input device
In computing, an input device is any peripheral used to provide data and control signals to an information processing system such as a computer or other information appliance...

s such as mice
Mouse (computing)
In computing, a mouse is a pointing device that functions by detecting two-dimensional motion relative to its supporting surface. Physically, a mouse consists of an object held under one of the user's hands, with one or more buttons...

 and keyboards
Keyboard (computing)
In computing, a keyboard is a typewriter-style keyboard, which uses an arrangement of buttons or keys, to act as mechanical levers or electronic switches...

, as well as access to the system tray on supporting systems. This package, along with javax.swing contains the largest number of enums (7 in all) in JDK 6.

java.rmi

The package provides Java remote method invocation
Java remote method invocation
The Java Remote Method Invocation Application Programming Interface , or Java RMI, is a Java application programming interface that performs the object-oriented equivalent of remote procedure calls ....

 to support remote procedure call
Remote procedure call
In computer science, a remote procedure call is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction...

s between two java applications running in different JVMs.

java.security

Support for security, including the message digest algorithm, is included in the package.

java.sql

An implementation of the JDBC API (used to access SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

 database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

s) is grouped into the package.

javax.rmi

The package provides the support for the remote communication between applications, using the RMI over IIOP protocol. This protocol combines RMI and CORBA features.

Java SE Core Technologies - CORBA / RMI-IIOP

javax.swing

Swing
Swing (Java)
Swing is the primary Java GUI widget toolkit. It is part of Oracle's Java Foundation Classes — an API for providing a graphical user interface for Java programs....

 is a collection of routines that build on java.awt to provide a platform independent widget toolkit
Widget toolkit
In computing, a widget toolkit, widget library, or GUI toolkit is a set of widgets for use in designing applications with graphical user interfaces...

. uses the 2D drawing routines to render the user interface components instead of relying on the underlying native operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 GUI support.

This package contains the largest number of classes (133 in all) in JDK 6. This package, along with java.awt also contains the largest number of enums (7 in all) in JDK 6. It supports pluggable looks and feels (PLAFs) so that widgets in the GUI can imitate those from the underlying native system. Design patterns permeate the system, especially a modification of the model-view-controller
Model-view-controller
Model–view–controller is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" from the user interface , permitting independent development, testing and maintenance of each .Model View Controller...

 pattern, which loosens the coupling
Coupling (computer science)
In computer science, coupling or dependency is the degree to which each program module relies on each one of the other modules.Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa...

 between function and appearance. One inconsistency is that (as of J2SE 1.3) fonts are drawn by the underlying native system, and not by Java, limiting text portability. Workarounds, such as using bitmap fonts, do exist. In general, "layouts" are used and keep elements within an aesthetically consistent GUI across platforms.

javax.swing.text.html.parser

The package provides the error tolerant HTML parser that is used for writing various web browsers and web bots.

javax.xml.bind.annotation

The package contains the largest number of Annotation Types (30 in all) in JDK 6. It defines annotations for customizing Java program elements to XML Schema mapping.

org.omg.CORBA

The package provides the support for the remote communication between applications using the General Inter-ORB Protocol and supports other features of the common object request broker architecture
Çorba
Chorba , ciorbă , shurpa , shorpo , or sorpa is one of various kinds of soup or stew found in national cuisines across Middle East...

. Same as RMI
Java remote method invocation
The Java Remote Method Invocation Application Programming Interface , or Java RMI, is a Java application programming interface that performs the object-oriented equivalent of remote procedure calls ....

 and RMI-IIOP
RMI-IIOP
RMI-IIOP denotes the Java Remote Method Invocation interface over the Internet Inter-Orb Protocol , which delivers Common Object Request Broker Architecture distributed computing capabilities to the Java 2 platform...

, this package is for calling remote methods of objects on other virtual machines (usually via network).

This package contains the largest number of Exception classes (45 in all) in JDK 6. From all communication possibilities CORBA is portable between various languages; however, with this comes more complexity.

org.omg.PortableInterceptor

The package contains the largest number of interfaces (39 in all) in JDK 6. It provides a mechanism to register ORB hooks through which ORB services can intercept the normal flow of execution of the ORB.

See also

  • Java EE
    Java Platform, Enterprise Edition
    Java Platform, Enterprise Edition or Java EE is widely used platform for server programming in the Java programming language. The Java platform differs from the Java Standard Edition Platform in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier...

  • Java ME
    Java Platform, Micro Edition
    Java Platform, Micro Edition, or Java ME, is a Java platform designed for embedded systems . Target devices range from industrial controls to mobile phones and set-top boxes...

  • Java Class Library
    Java Class Library
    The Java Class Library is a set of dynamically loadable libraries that Java applications can call at run time. Because the Java Platform is not dependent on any specific operating system, applications cannot rely on any of the existing libraries...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK