static void Main(string[] args) { RandData rand = new RandData(); Customer[] cs = new Customer[10]; for (int i = 0; i < cs.Length; i++) { cs[i] = new Customer(rand.getName(), rand.getTel(), rand.getAddress(), rand.getModel(), rand.getColor(), rand.getYear(), rand.getCompany()); cs[i].printCustomerInfo(); //Console.WriteLine(cs[i].ToString()); } }
static void Main(string[] args) { RandData rand = new RandData(); Student[] st = new Student[10]; for (int i = 0; i < st.Length; i++) { st[i] = new Student(rand.getName(), rand.getAge(), rand.getGender(), rand.getAddress()); Console.WriteLine(st[i].ToString()); } for (int i = 0; i < st.Length; i++) { st[9] = new Student("전우치", 24, '남', "조선 한양인근 두메산골"); Console.WriteLine(st[i].ToString()); } }