Hi,
Following is your solution:
Business Classes:
public class student
{
public string name { get; set; }
public string address { get; set; }
}
public class CollegeDetails
{
public string name { get; set; }
public student[] students { get; set; }
}
Implementation:
student[] arrStudent = new student[3];
CollegeDetails objOneCollage = new CollegeDetails();
for (int i = 0; i < arrStudent.Length - 1; i++)
{
student objStudent = new student();
objStudent.address = "Address for Student " + i.ToString();
objStudent.name = "Name for Student " + i.ToString();
arrStudent[i] = objStudent;
}
objOneCollage.students = arrStudent;
for (int i = 0; i < objOneCollage.students.Length - 1; i++)
{
Response.Write(String.Format("Student Name:{0} \t Student Address:{1} </br>", objOneCollage.students[i].name, objOneCollage.students[i].address));
}