Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: Java  |  size: 0.71 KB  |  hits: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.util.*;
  2.  
  3. public class TestToy{
  4.  
  5.                 toy[] anarray;
  6.        
  7.                 public static void main(String[] args) {
  8.                
  9.                 anarray = new toy[10];
  10.                 anarray[0] = new toy("TOY022 ", "Train Set          ", 2, 0.30);
  11.                 anarray[1] = new toy("TOY093 ", "Snake Rattle       ", 0, 0.10);
  12.                 anarray[2] = new toy("TOY837 ", "Home Science Kit   ", 5, 0.50);
  13.                 anarray[3] = new toy("TOY112 ", "Lego Technic Car   ", 9, 0.50);
  14.                 anarray[4] = new toy("TOY009 ", "Metal Tricycle     ", 3, 0.30);
  15.                 anarray[5] = new toy("TOY981 ", "Fabric Lion Puzzle ", 0, 0.20);
  16.  
  17.                 for (int i = 0; i < 6; i++) {
  18.                         System.out.print(anarray[i].toyID);
  19.                         System.out.print(anarray[i].description);
  20.                         System.out.println(anarray[i].minAge + "yo");
  21.                 }