Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Class
- {
- public string Letter { get; set; }
- public int Number { get; set; }
- public Class (int number, string letter) { this.Letter = letter; this.Number = number; }
- }
- public class Student
- {
- public string Name { get; set; }
- public Class Class { get; set; }
- public int NumberInClass { get; set; }
- public string UniqueClassNumber
- {
- get
- {
- return this.Class.Number + this.Class.Letter + this.NumberInClass
- }
- }
- public Student (string name, int number, Class class) { ... }
- }
- И съответно
- Class c = new Class(11, "a");
- Student pesho = new Student("pesho", 16, c);
- Console.WriteLine(pesho.UniqueNumber); // 11a16
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement