Anda di halaman 1dari 3

addition, subtraction, multiplication, division

JAVA Quick Reference +, -, *, /


%, ++, -- modulus, increment, decrement.
abstract boolean break byte byvalue
Author: Jialong He case cast catch char class
Jialong_he@bigfoot.com Relational Operators const continue default do double
http://www.bigfoot.com/~jialong_he
==, !=, >, <, equal, not equal, greater, less, else extends false final finally
>=, <= greater or equal, less or equal.
Simple Data Types float for future generic goto

8 -128..127
Logical Operators if implements import inner instanceof
byte
&, |, !, ^, ||, &&, AND, OR, NOT, XOR, short -circuit OR, AND int interface long native new
short 16 -32,768..32,767
Bitwise Operators null operator outer package private
int 32 -2,147,483,648.. 2,147,483,647
64 -9,223,372,036,854,775,808.. AND, OR, NOT, XOR protected public rest return short
long &, |, ~, ^,
9,223,372,036,854,775,807 >>, >>>, << shift right, shift right zero fill, shift left. static super switch synchronized this
float 32 3.4e-0.38.. 3.4e+0.38 Comments throw throws transient true try
double 64 1.7e-308.. 1.7e+308 var void volatile while
// rest of line
char 16 Complete Unicode Character Set /* multiline comment */
/** documentation comment */ Java packages
Boolean true, false
java.applet Provides the classes necessary to create an applet
decare a variable: Compile and Run and the classes an applet uses to communicate with
type identifier [= value];
javac nameOfFile.java its applet context.
java nameOfFile
java.awt Contains all of the classes for creating user
interfaces and for painting graphics and images.
Arrays CLASSPATH must set correctly.
The name of the file has to match exactly the name of the class. java.awt.color Provides classes for color spaces.
int array_name[ ]; declare an integer array and allocate
array_name=new int[100 ]; 100 elements of memory. Flow Control java.awt.datatransfe Provides interfaces and classes for transferring data
r between and within applications.
int array_name[ ] = new int [ declare and allocate an integer array in
if (Boolean-expression) statement1; [ else statement2; ] Drag and Drop is a direct manipulation gesture
100]; one statement. java.awt.dnd
while loop
int array_name [ ] = {1, 2, 3, 4}; found in many Graphical User Interface systems
[initialization]
that provides a mechanism to transfer information
while (termination-clause) { between two entities logically associated with
int array_name[] = new multidimensional array. body; presentation elements in the GUI.
int[10][20]; [iteration;]
} java.awt.event Provides interfaces and classes for dealing with
null for reference type (class, array). do while loop different types of events fired by AWT
do { components.
body;
java.awt.font Provides classes and interface relating to fonts.
[iteration;]
Class } while (termination-clause); java.awt.geom Provides the Java 2D classes for defining and
for loop performing operations on objects related to two-
{public|final|abstract} class name dimensional geometry.
for (initialization; termination-clause; iteration)
{ [class_variable_declarations]
body;
public static void main{String[] args) {statements} java.awt.im Provides classes and interfaces for the input method
[methods] framework.
Program Structure
} Provides interfaces that enable the development of
class className { java.awt.im.spi
public static void main (String args[ ]) { input methods that can be used with any Java
this, super runtime environment.
statements;
Methods } Provides classes for creating and modifying
java.awt.image
method definition1 images.
{public | private } [static] {type | void} name(arg, ..., arg ) {statements} …
method definitionN java.awt.image.rend Provides classes and interfaces for producing
Variable } erable rendering-independent images.
{public | private } [static] type name [= expression]; java.awt.print Provides classes and interfaces for a general
printing API.
Arithmetic Operators
Key words java.beans Contains classes related to developing beans --
components based on the JavaBeansTM architecture.
java.beans.beancont Provides classes and interfaces relating to bean Signature Algorithm) keys as defined in NIST's the plug-in interfaces for readers, writers,
ext context. FIPS-186. transcoders, and streams, and a runtime registry.
java.io Provides for system input and output through data java.security.spec Provides classes and interfaces for key javax.imageio.strea A package of the Java Image I/O API dealing with
streams, serialization and the file system. specifications and algorithm parameter m low-level I/O from files and streams.
specifications.
java.lang Provides classes that are fundamental to the design javax.naming Provides the classes and interfaces for accessing
of the Java programming language. java.sql Provides the API for accessing and processing data naming services.
stored in a data source (usually a relational
java.lang.ref Provides reference-object classes, which support a javax.naming.direct Extends the javax.naming package to provide
database) using the Java TM programming language.
limited degree of interaction with the garbage ory functionality for accessing directory services.
collector. java.text Provides classes and interfaces for handling text,
dates, numbers, and messages in a manner javax.naming.event Provides support for event notification when
java.lang.reflect Provides classes and interfaces for obtaining accessing naming and directory services.
independent of natural languages.
reflective information about classes and objects.
javax.naming.ldap Provides support for LDAPv3 extended operations
java.util Contains the collections framework, legacy
java.math Provides classes for performing arbitrary-precision and controls.
collection classes, event model, date and time
integer arithmetic (BigInteger) and arbitrary-
facilities, internationalization, and miscellaneous javax.naming.spi Provides the means for dynamically plugging in
precision decimal arithmetic (BigDecimal).
utility classes (a string tokenizer, a random-number support for accessing naming and directory services
java.net Provides the classes for implementing networking generator, and a bit array). through the javax.naming and related packages.
applications.
java.util.jar Provides classes for reading and writing the JAR javax.net Provides classes for networking applications.
java.nio Defines buffers, which are containers for data, and (Java ARchive) file format, which is based on the
javax.net.ssl Provides classes for the secure socket package.
provides an overview of the other NIO packages. standard ZIP file format with an optional manifest
file. javax.print Provides the principal classes and interfaces for the
java.nio.channels Defines channels, which represent connections to
TM JavaTM Print Service API.
entities that are capable of performing I/O java.util.logging Provides the classes and interfaces of the Java 2
operations, such as files and sockets; defines platform's core logging facilities. javax.print.attribute Provides classes and interfaces that describe the
selectors, for multiplexed, non-blocking I/O types of JavaTM Print Service attributes and how
java.util.prefs This package allows applications to store and
operations. they can be collected into attribute sets.
retrieve user and system preference and
java.nio.channels.spi Service-provider classes for the configuration data. javax.print.attribute Package javax.print.attribute.standard contains
java.nio.channels package. .standard classes for specific printing attributes.
java.util.regex Classes for matching character sequences against
java.nio.charset Defines charsets, decoders, and encoders, for patterns specified by regular expressions. javax.print.event Package javax.print.event contains event classes
translating between bytes and Unicode characters. and listener interfaces.
java.util.zip Provides classes for reading and writing the
java.nio.charset.spi standard ZIP and GZIP file formats. javax.rmi Contains user APIs for RMI-IIOP.
Service-provider classes for the java.nio.charset
package. Java extension packages javax.rmi.CORBA Contains portability APIs for RMI-IIOP.
java.rmi Provides the RMI package. javax.security.auth This package provides a framework for
javax.accessibility Defines a contract between user-interface authentication and authorization.
java.rmi.activation Provides support for RMI Object Activation. components and an assistive technology that
provides access to those components. javax.security.auth.c This package provides the classes necessary for
java.rmi.dgc Provides classes and interface for RMI distributed
allback services to interact with applications in order to
garbage-collection (DGC). javax.crypto Provides the classes and interfaces for
retrieve information (authentication data including
Provides a class and two interfaces for the RMI cryptographic operations. usernames or passwords, for example) or to display
java.rmi.registry
registry. javax.crypto.interfa Provides interfaces for Diffie-Hellman keys as information (error and warning messages, for
ces defined in RSA Laboratories' PKCS #3. example).
java.rmi.server Provides classes and interfaces for supporting the
server side of RMI. javax.crypto.spec Provides classes and interfaces for key javax.security.auth. This package contains utility classes related to the
specifications and algorithm parameter kerberos Kerberos network authentication protocol.
java.security Provides the classes and interfaces for the security
specifications.
framework. javax.security.auth.l This package provides a pluggable authentication
javax.imageio The main package of the Java Image I/O API. ogin framework.
java.security.acl The classes and interfaces in this package have
been superseded by classes in the java.security javax.imageio.event A package of the Java Image I/O API dealing with javax.security.auth.s This package provides the interface to be used for
package. synchronous notification of events during the pi implementing pluggable authentication modules.
reading and writing of images.
java.security.cert Provides classes and interfaces for parsing and javax.security.auth. This package contains the classes that should be
managing certificates, certificate revocation lists javax.imageio.metad A package of the Java Image I/O API dealing with x500 used to store X500 Principal and X500 Private
(CRLs), and certification paths. ata reading and writing metadata. Crendentials in a Subject.
java.security.interfa Provides interfaces for generating RSA (Rivest, javax.imageio.plugin Classes supporting the built -in JPEG plug-in. javax.security.cert Provides classes for public key certificates.
ces Shamir and Adleman AsymmetricCipher s.jpeg
javax.sound.midi Provides interfaces and classes for I/O, sequencing,
algorithm) keys as defined in the RSA Laboratory
javax.imageio.spi A package of the Java Image I/O API containing and synthesis of MIDI (Musical Instrument Digital
Technical Note PKCS#1, and DSA (Digital
Interface) data.
javax.sound.midi.spi Supplies interfaces for service providers to which allows the transaction manager to enlist and
implement when offering new MIDI devices, MIDI delist resource objects (supplied by the resource
file readers and writers, or sound bank readers. manager driver) in JTA transactions.
javax.sound.sample Provides interfaces and classes for capture, javax.xml.parsers Provides classes allowing the processing of XML
d processing, and playback of sampled audio data. documents.
javax.sound.sample Supplies abstract classes for service providers to javax.xml.transform This package defines the generic APIs for
d.spi subclass when offering new audio devices, sound processing transformation instructions, and
file readers and writers, or audio format converters. performing a transformation from source to result.
javax.sql Provides the API for server side data source access javax.xml.transform This package implements DOM-specific
and processing from the JavaTM programming .dom transformation APIs.
language.
javax.xml.transform This package implements SAX2-specific
javax.swing Provides a set of "lightweight" (all-Java language) .sax transformation APIs.
components that, to the maximum degree possible,
work the same on all platforms. javax.xml.transform This package implements stream- and URI-
.stream specific transformation APIs.
javax.swing.border Provides classes and interface for drawing
specialized borders around a Swing component.
javax.swing.colorch Contains classes and interfaces used by the
ooser JColorChooser component.
javax.swing.event Provides for events fired by Swing components.
javax.swing.filechoo Contains classes and interfaces used by the
ser JFileChooser component.
javax.swing.plaf Provides one interface and many abstract classes
that Swing uses to provide its pluggable look-and-
feel capabilities.
javax.swing.plaf.bas Provides user interface objects built according to
ic the Basic look and feel.
javax.swing.plaf.met Provides user interface objects built according to
al the Java look and feel (once codenamed Metal),
which is the default look and feel.
javax.swing.plaf.mul Provides user interface objects that combine two or
ti more look and feels.
javax.swing.table Provides classes and interfaces for dealing with
javax.swing.JTable.
javax.swing.text Provides classes and interfaces that deal with
editable and noneditable text components.
javax.swing.text.htm Provides the class HTMLEditorKit and supporting
l classes for creating HTML text editors.
javax.swing.text.htm Provides the default HTML parser, along with
l.parser support classes.
javax.swing.text.rtf Provides a class (RTFEditorKit) for creating Rich-
Text-Format text editors.
javax.swing.tree Provides classes and interfaces for dealing with
javax.swing.JTree.
javax.swing.undo Allows developers to provide support for undo/redo
in applications such as text editors.
javax.transaction Contains three exceptions thrown by the ORB
machinery during unmarshalling.
javax.transaction.xa Provides the API that defines the contract between
the transaction manager and the resource manager,

Anda mungkin juga menyukai