FileDocCategorySizeDatePackage
ArrayNew.javaAPI DocExample2831Mon Apr 06 18:10:26 BST 1998None

ArrayNew

public class ArrayNew extends Object

Fields Summary
static Random
rand
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    int[] a;
    a = new int[pRand(20)];
    prt("length of a = " + a.length);
    for(int i = 0; i < a.length; i++)
      prt("a[" + i + "] = " + a[i]);
  
static intpRand(int mod)

      
    return Math.abs(rand.nextInt()) % mod + 1;
  
static voidprt(java.lang.String s)

    System.out.println(s);