Home Segments Top Top Previous Next

61: Mainline

When you tell the Java compiler the type of a variable, you are said to declare the variable. Thus, the following program fragment exhibits three variable declarations. All three variables are declared to be integer variables, because each is preceded by the data-type–declaring int keyword:

public class Demonstrate { 
 public static void main (String argv[]) { 
  int script; 
  int acting; 
  int direction; 
  ... 
 } 
}