//Java program to understand the concept of association
class School
{
private String school_name;
School(String school_name)
{
this.school_name = school_name;
}
public String getSchoolName()
{
return this.school_name;
}
}
class Student
{
private String student_name;
Student(String student_name)
{
this.student_name = student_name;
}
public String getStudentName()
{
return this.student_name;
}
}
public class Main
{
public static void main(String args[])
{
School s = new School("Sarsvati Vidyalaya");
Student st = new Student("Hansraj Rami");
System.out.println(st.getStudentName() + " is student of " + s.getSchoolName());
//school can have many number of students so it is one to many relationship
}
}