I'll try to show you with some examples.
First assume we have a school and students, let's say that the school has many students and a student is in one school
Then you will have something like that in your class, this will be for the 1-n
public class School
{
private string name;
private List<Student> students; // which is the list of the student
}
public class Student
{
private string name;
private School school; //which represent the school of the student
}
Now let's assume that a student has class, he can have more than one, so it's a n-n relation:
public class Student
{
private string name;
private School school; //which represent the school of the student
private List<Class> classes; //Represent all the class he attends
}
public class Class
{
private string name;
private List<Student> students; //Represent all the students attending the class
}
And basically for the 1-1 you don't represent it, because in database when you have 1-1 the relation is useless and you merge both table to make just one.
Hope it helps
Edit:
Sometimes it seems to be useful to have a 1-1 relation in your class.
So let's take the example of a car and engine.
public class Car
{
private string name;
private Engine engine; // the engine of the car
}
public class Engine
{
private string name;
private string power;
private Car car; // the car of the engine
}
In that case, it would be useful for the clarity of the code.
Thanks to Corak