Java Quick Reference Guide

ADVERTISEMENT

JAVA Quick Reference
addition, subtraction, multiplication, division
+, -, *, /
abstract
boolean
break
byte
byvalue
modulus, increment, decrement.
%, ++, --
case
cast
catch
char
class
Author: Jialong He
Relational Operators
const
continue
default
do
double
equal, not equal, greater, less,
==, !=, >, <,
else
extends
false
final
finally
greater or equal, less or equal.
>=, <=
float
for
future
generic
goto
Simple Data Types
Logical Operators
i f
implements
import
inner
instanceof
8
-128..127
byte
AND, OR, NOT, XOR, short -circuit OR, AND
&, |, !, ^, ||, &&,
int
interface
long
native
new
16
-32,768..32,767
short
null
operator
outer
package
private
Bitwise Operators
32
-2,147,483,648.. 2,147,483,647
int
protected public
rest
return
short
64
-9,223,372,036,854,775,808..
AND, OR, NOT, XOR
long
&, |, ~, ^,
9,223,372,036,854,775,807
shift right, shift right zero fill, shift left.
>>, >>>, <<
static
super
switch
synchronized this
32
3.4e-0.38.. 3.4e+0.38
Comments
throw
throws
transient
true
try
float
64
1.7e-308.. 1.7e+308
var
void
volatile
while
double
// rest of line
16
Complete Unicode Character Set
/* multiline comment */
char
Java packages
/** documentation comment */
true, false
Boolean
Provides the classes necessary to create an applet
java.applet
Compile and Run
decare a variable:
and the classes an applet uses to communicate with
type identifier [= value];
javac nameOfFile.java
its applet context.
java nameOfFile
Contains all of the classes for creating user
java.awt
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.
Provides classes for color spaces.
java.awt.color
int
array_name[ ];
declare an integer array and allocate
Provides interfaces and classes for transferring data
array_name=new
int[100 ];
100 elements of memory.
Flow Control
java.awt.datatransfe
between and within applications.
r
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;]
}
Provides interfaces and classes for dealing with
java.awt.event
for reference type (class, array).
null
different types of events fired by AWT
do while loop
components.
do {
body;
Provides classes and interface relating to fonts.
java.awt.font
[iteration;]
Class
Provides the Java 2D classes for defining and
} while (termination-clause);
java.awt.geom
performing operations on objects related to two-
for loop
{public|final|abstract} class name
dimensional geometry.
for (initialization; termination-clause; iteration)
{ [class_variable_declarations]
body;
Provides classes and interfaces for the input method
public static void main{String[] args) {statements}
java.awt.im
framework.
[methods]
Program Structure
}
Provides interfaces that enable the development of
class className {
java.awt.im.spi
input methods that can be used with any Java
public static void main (String args[ ]) {
this, super
runtime environment.
statements;
}
Methods
java.awt.image
Provides classes for creating and modifying
method definition1
images.
{public
|
private
} [static] {type | void} name(arg, ..., arg ) {statements}
Provides classes and interfaces for producing
method definitionN
java.awt.image.rend
Variable
rendering-independent images.
}
erable
Provides classes and interfaces for a general
{public
|
private
} [static] type name [= expression];
java.awt.print
printing API.
Arithmetic Operators
Key words
Contains classes related to developing beans --
java.beans
TM
components based on the JavaBeans
architecture.

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 3