
Untitled
By: a guest on
Apr 25th, 2012 | syntax:
Java | size: 0.71 KB | hits: 37 | expires: Never
import java.util.*;
public class TestToy{
toy[] anarray;
public static void main(String[] args) {
anarray = new toy[10];
anarray[0] = new toy("TOY022 ", "Train Set ", 2, 0.30);
anarray[1] = new toy("TOY093 ", "Snake Rattle ", 0, 0.10);
anarray[2] = new toy("TOY837 ", "Home Science Kit ", 5, 0.50);
anarray[3] = new toy("TOY112 ", "Lego Technic Car ", 9, 0.50);
anarray[4] = new toy("TOY009 ", "Metal Tricycle ", 3, 0.30);
anarray[5] = new toy("TOY981 ", "Fabric Lion Puzzle ", 0, 0.20);
for (int i = 0; i < 6; i++) {
System.out.print(anarray[i].toyID);
System.out.print(anarray[i].description);
System.out.println(anarray[i].minAge + "yo");
}