Scope |
Word |
What is it? |
Java |
abstract |
place holder for method that can be provided by
a sub class.
classes containing abstract methods can not be instantiated
as they define behaviour and not details of that implementation
|
Java |
class |
begins a new class declaration
|
Java |
extends |
inheritance
class myclass extends baseclass
{
...
}
|
Java |
implements |
sub-class declares which abstract classes it is implementing
class myclass extends baseclass
implements abstract_class,...
{
...
}
|
Java |
import |
imports classes from the named package
import Classes
class myclass...
{
...
}
|
Java |
friendly |
the method is accessible from any class in the package
|
Script |
function |
defines a Javascript class or method.
|
Java |
interface |
used to make entirely abstract classes with no implementation
public interface myclass
{
list abstract methods
}
|
Java |
native |
interfaces C code with Java. names of Native methods must match
the name of the C function.
classes should instruct the linker to link against the appropriate library
public class myclass
{
static
{
Linker.loadlibrary("a_C_library")
}
public native float the_C_function(args);
}
|
Java |
package |
groups classes together. the import statement will suck in all classes that
belong to a package.
Package statement goes at the top of the file
|
Java |
private |
the method is not accesible from outside the class.
|
Java |
protected |
the method is not accessible from outside the class or sub-classes
|
Java |
public |
the method is accessible from any class.
|
Java |
super |
call same named method from the superclass. generally the last
statement in a method that has been overridden
|
Script + Java |
this |
reference to the current object
|
Java |
void |
method that has no return value
|
Java |
with |
similar to pascal, the following are equivalent:
class.property1 = something;
class.method1();
with class
{
property1 = something;
method(1);
}
|
Word |
What is it? |
break |
Used within looping blocks: for ,
while and do .
Causes flow of control to exit the block.
|
case |
A selector in a switch statement |
continue |
Used within looping blocks: for ,
while and do .
Program execution continues at the top
of the loop.
|
default |
Marks the block of code to be executed if no other
selectors in the swicth block are applicable.
|
do |
A conditional loop with the loop incrementor at the bottom of the block
This loop will be executed at least once.
do
{
}
while (something);
|
else |
used in if statementss.
|
final |
purpose unknown
|
finally |
used on loops . Statements in the finally
block will be executed unless the loop was prematurely
exited with a break
while(something)
{
statements
}
finally
{
will be executed if the loop ran to
normal completion
}
|
for |
loop, body of which is executed as many times as the
condition is met. Each time around the loop the control variable
is updated according to the incrementor expression
for (initial value; condition; incrementing expression)
{
}
for (i=1; i<12; i++)
{
}
|
if |
Conditional branching
if (expression)
{
expression was true
}
else
{
expression was false
}
|
return |
quits method and returns a value
|
switch |
switch (variable)
{
case value1:
{
}
case value2:
{
}
...
case default:
}
|
while |
A conditional loop with controlling expression at the top of the block
This loop will be executed only if nd while the expression is true.
while (expression)
{
}
|