-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person.cs
77 lines (67 loc) · 1.61 KB
/
Person.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Linq;
namespace Encapsulation
{
internal class Person
{
private string _name;
private string _surName;
private int _age;
private readonly bool _isMarried;
public string Name {
get {
return this._name;
}
set
{
if (value.Length > 4)
{
this._name = value;
}
else
{
Console.WriteLine("Adin uzunlugu duzgun qeyd edilmeyib");
}
}
}
public string SurName { get; }
public int Age { get; set; }
public bool IsMarried { get; }
//public Person()
//{
// this._isMarried = false;
//}
//public string getname()
//{
// return this.name;
//}
//public void setName(string name)
//{
// if (name.Length > 4)
// {
// this.Name = name;
// }
// else
// {
// Console.WriteLine("Adin uzunlugu duzgun qeyd edilmeyib");
// }
//}
//public int getAge()
//{
// return this.Age;
//}
//public void setAge(int age)
//{
// if (age >= 18)
// {
// this.Age = age;
// }
// else
// {
// Console.WriteLine("Yashiniz duzgun deyil");
// }
//}
}
}