chapter 4 practice 3
create a reference array with class P2
//: c4/P3.java
// create a reference array with class P2
import java.util.*;
public class P3{
static Random rand = new Random();
static int pRand(int mod){
return Math.abs(rand.nextInt()) % mod + 1;
}
public static void main(String[] args){
P2[] nbs = new P2[pRand(10)];
System.out.println("nbs's length is: " + nbs.length);
System.out.println("OK.There will no notebook object be created.");
}
}