Personal notes on Java
For other technologies like HTML, CSS, .NET, PHP, etc. check my other blog

Java packages

Resources:
NOTES:
The java.lang.* and java.util.* Packages: These 2 packages provide basic functionality used by almost all applications. Other packages with names that begin with java.lang and java.util provide supplemental APIs for specific features.
java.lang is the default package for java. It provides classes that are fundamental to the design of the Java programming language, and this is why you don't need to import it explicitly with import java.lang.*.(every java program already imports it implicitly).

Curiosity: javax vs java package

List with a couple of java packages (for a full list check: Official Java™ Platform, Standard Edition 7 - API Specification):
Package Description
java.applet
Provides the classes necessary to create an applet and the classes an applet uses to communicate with its applet context.
java.awt
Contains all of the classes for creating user interfaces and for painting graphics and images.
java.beans
Contains classes related to developing beans -- components based on the JavaBeans™ architecture.
java.io
Provides for system input and output through data streams, serialization and the file system.
java.lang
Provides classes that are fundamental to the design of the Java programming language.
java.math
Provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).
java.net
Provides the classes for implementing networking applications.
java.rmi
Provides the RMI package.
java.security
Provides the classes and interfaces for the security framework.
java.sql
Provides the API for accessing and processing data stored in a data source (usually a relational database) using the JavaTM programming language.
java.text
Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.
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.util.concurrent
Utility classes commonly useful in concurrent programming.
java.util.concurrent.atomic
A small toolkit of classes that support lock-free thread-safe programming on single variables.
java.util.concurrent.locks
Interfaces and classes providing a framework for locking and waiting for conditions that is distinct from built-in synchronization and monitors.
java.util.regex
Classes for matching character sequences against patterns specified by regular expressions.
java.util.zip
Provides classes for reading and writing the standard ZIP and GZIP file formats.
javax.crypto
Provides the classes and interfaces for cryptographic operations.
javax.imageio
The main package of the Java Image I/O API.
javax.naming
Provides the classes and interfaces for accessing naming services.
javax.naming.directory
Extends the javax.naming package to provide functionality for accessing directory services.
javax.naming.event
Provides support for event notification when accessing naming and directory services.
javax.naming.ldap
Provides support for LDAPv3 extended operations and controls.
javax.net
Provides classes for networking applications.
javax.rmi
Contains user APIs for RMI-IIOP.
javax.sound.midi
Provides interfaces and classes for I/O, sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data.
javax.sql
Provides the API for server side data source access and processing from the JavaTM programming language.
javax.swing
Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
javax.xml
javax.xml.bind
Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.
javax.xml.bind.util
Useful client utility classes.
javax.xml.crypto
Common classes for XML cryptography.
javax.xml.datatype
XML/Java Type Mappings.
javax.xml.namespace
XML Namespace processing.
javax.xml.parsers
Provides classes allowing the processing of XML documents.
javax.xml.soap
Provides the API for creating and building SOAP messages.
javax.xml.validation
This package provides an API for validation of XML documents.
javax.xml.ws
This package contains the core JAX-WS APIs.
javax.xml.xpath
This package provides an object-model neutral API for the evaluation of XPath expressions and access to the evaluation environment.

java.lang

This is the default package for java language. It provides classes that are fundamental to the design of the Java programming language, and this is why you don't need to import it explicitly with import java.lang.*.

Main classes defined in java.lang package:

Enum<E extends Enum<E>>: This is the common base class of all Java language enumeration types.
Math: The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.
Number: The abstract class Number is the superclass of classes BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, and Short.
Object:    Class Object is the root of the class hierarchy.
SecurityManager: The security manager is a class that allows applications to implement a security policy.
String:    The String class represents character strings.
StringBuffer: A thread-safe, mutable sequence of characters.
StringBuilder: A mutable sequence of characters.
System:    The System class contains several useful class fields and methods.
Thread:    A thread is a thread of execution in a program.
All the primitive wrapper classes like: Integer; Double; Short; Boolean; etc.

Main interfaces defined in java.lang package:

Cloneable: A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class.
Comparable<T>: This interface imposes a total ordering on the objects of each class that implements it.
Iterable<T>: Implementing this interface allows an object to be the target of the "foreach" statement.
Runnable: The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread.

Enum defined in java.lang package:

Thread.State: A thread state.

Annotation Types defined in java.lang package:

Deprecated:    A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists.
Override: Indicates that a method declaration is intended to override a method declaration in a superclass.
SuppressWarnings: Indicates that the named compiler warnings should be suppressed in the annotated element (and in all program elements contained in the annotated element).

Main Exceptions defined in java.lang package:

ArrayIndexOutOfBoundsException: Thrown to indicate that an array has been accessed with an illegal index.
Exception: The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch.
IndexOutOfBoundsException: Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range.
NullPointerException: Thrown when an application attempts to use null in a case where an object is required.
NumberFormatException: Thrown to indicate that the application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format.
RuntimeException: RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine.
StringIndexOutOfBoundsException: Thrown by String methods to indicate that an index is either negative or greater than the size of the string.
UnsupportedOperationException: Thrown to indicate that the requested operation is not supported.

Package 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). Many of the interfaces and classes defined in java.util are collection-related (List; ArrayList; Hashtable; Vector; etc.).
The list below is incomplete and seperates this classes and interfaces from the rest (for the full list check the java.util javadoc):

Non-Collection-Realated:

Interfaces Summary:
Interface Description
Observer
A class can implement the Observer interface when it wants to be informed of changes in observable objects.
Class Summary
Class Description
Arrays
This class contains various methods for manipulating arrays (such as sorting and searching).
Calendar
The Calendar class is an abstract class that provides methods for converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week.
Collections
This class consists exclusively of static methods that operate on or return collections.
Currency
Represents a currency.
Date
The class Date represents a specific instant in time, with millisecond precision.
EventObject
The root class from which all event state objects shall be derived.
GregorianCalendar
GregorianCalendar is a concrete subclass of Calendar and provides the standard calendar system used by most of the world.
Locale
A Locale object represents a specific geographical, political, or cultural region.
Locale.Builder
Builder is used to build instances of Locale from values configured by the setters.
Objects
This class consists of static utility methods for operating on objects.
Observable
This class represents an observable object, or "data" in the model-view paradigm.
Properties
The Properties class represents a persistent set of properties.
PropertyPermission
This class is for property permissions.
PropertyResourceBundle
PropertyResourceBundle is a concrete subclass of ResourceBundle that manages resources for a locale using a set of static strings from a property file.
Random
An instance of this class is used to generate a stream of pseudorandom numbers.
ResourceBundle
Resource bundles contain locale-specific objects.
Scanner
A simple text scanner which can parse primitive types and strings using regular expressions.
SimpleTimeZone
SimpleTimeZone is a concrete subclass of TimeZone that represents a time zone for use with a Gregorian calendar.
StringTokenizer
The string tokenizer class allows an application to break a string into tokens.
Timer
A facility for threads to schedule tasks for future execution in a background thread.
TimerTask
A task that can be scheduled for one-time or repeated execution by a Timer.
TimeZone
TimeZone represents a time zone offset, and also figures out daylight savings.
UUID
A class that represents an immutable universally unique identifier (UUID).

Collection related:

Interface summary:
Interface Description
Collection<E>
The root interface in the collection hierarchy.
Comparator<T>
A comparison function, which imposes a total ordering on some collection of objects.
Enumeration<E>
An object that implements the Enumeration interface generates a series of elements, one at a time.
EventListener
A tagging interface that all event listener interfaces must extend.
Iterator<E>
An iterator over a collection.
List<E>
An ordered collection (also known as a sequence).
ListIterator<E>
An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list.
Map<K,V>
An object that maps keys to values.
Map.Entry<K,V>
A map entry (key-value pair).
NavigableMap<K,V>
A SortedMap extended with navigation methods returning the closest matches for given search targets.
NavigableSet<E>
A SortedSet extended with navigation methods reporting closest matches for given search targets.
Queue<E>
A collection designed for holding elements prior to processing.
Set<E>
A collection that contains no duplicate elements.
SortedMap<K,V>
A Map that further provides a total ordering on its keys.
SortedSet<E>
A Set that further provides a total ordering on its elements.
Class Summary
Class Description
ArrayList<E>
Resizable-array implementation of the List interface.
Arrays
This class contains various methods for manipulating arrays (such as sorting and searching).
Collections
This class consists exclusively of static methods that operate on or return collections.
Dictionary<K,V>
The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to values.
HashMap<K,V>
Hash table based implementation of the Map interface.
HashSet<E>
This class implements the Set interface, backed by a hash table (actually a HashMap instance).
Hashtable<K,V>
This class implements a hash table, which maps keys to values.
LinkedHashMap<K,V>
Hash table and linked list implementation of the Map interface, with predictable iteration order.
LinkedHashSet<E>
Hash table and linked list implementation of the Set interface, with predictable iteration order.
LinkedList<E>
Doubly-linked list implementation of the List and Deque interfaces.
PriorityQueue<E>
An unbounded priority queue based on a priority heap.
Stack<E>
The Stack class represents a last-in-first-out (LIFO) stack of objects.
TreeMap<K,V>
A Red-Black tree based NavigableMap implementation.
TreeSet<E>
A NavigableSet implementation based on a TreeMap.
Vector<E>
The Vector class implements a growable array of objects.
WeakHashMap<K,V>
Hash table based implementation of the Map interface, with weak keys.

Sem comentários:

Enviar um comentário