We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7d64c0 commit 2699b65Copy full SHA for 2699b65
2 files changed
source/code/projects/Properties_errors/Properties_errors/Derived.cs
@@ -30,6 +30,16 @@ public string Attr1
30
}
31
32
*/
33
+
34
+ // A similar issue is to have a setter that does nothing:
35
36
+ public string Attr2 {get{return attr1;} set{}}
37
38
+ public string GetAttr2(){
39
+ return attr1;
40
+ }
41
42
43
// Misconception #2
44
public void Test(string argP)
45
{
source/code/projects/Properties_errors/Properties_errors/Program.cs
@@ -9,6 +9,9 @@ static void Main()
9
10
test1.Test(null);
11
test1.Test();
12
13
+ test1.Attr2 = "This is the parameter.";
14
+ Console.WriteLine(test1.GetAttr2());
15
16
try
17
0 commit comments