boolean isAuthorized = true; char size = 'm'; int age = 30; long ProductID = 01928493;
Arrays can be created and populated as shown below. Remember that Cold-Fusion arrays starts at 1; Java arrays start at 0.
In this example, an array of length 3 that will hold int s is declared. The first two cells are then populated with the values 1 and 2, respectively.
int[] numbers = new int[3]; numbers[0] = 1; numbers[1] = 2;
In this example, an int array is created and populated at the same time.
int[] numbers = {1,2,3};
Arrays can also be populated in loops .
String name; String name = ''Zoe''; String name = new String(); Button saveButton = new Button(''save'');
Top |