Java Reference
In-Depth Information
Some of the most useful code templates are listed in the table below, please note that
code templates are case sensitive.
Abbreviation Example expanded text
Description
public static final
Useful when declaring
public static final variables.
Psf
forc
for (Iterator it = list.
iterator();
it.hasNext();) {
Object object = it.next();
Use a standard for loop to
iterate through a collection.
}
fore
Use the enhanced for loop to
iterate through a collection.
for (Object object : list) {
}
ifelse
if (boolVar) {
Generate an if-else
conditional.
} else {
}
psvm
public static void main(String[]
args) {
Generate a main method for
our class.
}
soutv
System.out.println("boolVar = "
+
Generate a System.out.
println() statement
displaying the value of a
variable.
boolVar);
trycatch
try {
Generate a try/catch block.
} catch (Exception exception) {
}
whileit
while (iterator.hasNext()) {
Object object = iterator.
next();
}
Generate a while loop to
iterate through an Iterator.
To see the complete list of code templates, click on Tools | Options , click on the
Editor icon, then on the Code Templates tab.
 
Search WWH ::




Custom Search