Java   View all facts   Glossary   Help
syntactic unit > definition
Next syntactic unitexpression    Upsyntactic unit    Previous syntactic unitdeclaration   

definition comparison table
Subject have example have syntax occur before has definition have purpose have store in contain is a subtopic of have part
class definition
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
public abstract final class nameOfClass extends Super implements Interfaces
{
ClassBody
}
 A definition that specifies a class and includes the class bodyto define a class1 or more constructors for the classsource file with the same name as the class and extension .javaclass methods, class variables, instance methods, instance variablesClassesclass declaration, class body
interface definition
public interface Drawable
{
public abstract Image drawImage();
public abstract Image drawImage(int height, int width);
public abstract Image drawBlackAndWhiteImage(int height, int width);
}
public interface InterfaceName extends SuperInterfaces
{
InterfaceBody
}
  to define an interface   Interfaces interface declaration, interface body
method definition
int[] makeRange(int lower int upper) {
//body of this method
}
accessLevel static abstract final native synchronized returnType methodName (parameterList) throws exceptions
{
MethodBody
}
calls to that method to define a method   Methods 
variable definition    to define a variable   Variables and Data Types declaration

Next syntactic unitexpression    Upsyntactic unit    Previous syntactic unitdeclaration