Sunday, February 22, 2009

source code for array Declaration

// sample example to show array Declaration

package arrays;

public class ArrayDeclarationExample {

public static void main(String[] args) {

// the following are the valid array declarations
int [] a;
int [][] a;
int [][][]a;
int a[][];
int a[][][];
int [] a[][];
int [] a[][];
int [][]a;
int [][] a[];
int[] a,b[];
int a,b[];
int [][]a[];

// not valid array decarations

int[6] a;
int[] a,[]b;



Anonymous said...

good one

Post a Comment