-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathStudent.cs
More file actions
32 lines (30 loc) · 785 Bytes
/
Student.cs
File metadata and controls
32 lines (30 loc) · 785 Bytes
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
using System;
using System.Collections.Generic;
using System.Text;
namespace OOP_Introduction_Explained
{
// Here we can either write or read data to this class
class Student : Person
{
// private field (backing field) hold any data assigned Name property
private string _name;
public Student()
{
_name = "";
}
// This is the Name Property
public string Name
{
// use the Get accessor to read data from the class
get
{
return _name;
}
set
{
// The value property of the set accessor is automatically created by the compiler
_name = value;
}
}
}
}