Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/Break-OO-privacy/C-sharp/break-oo-privacy-1.cs
Normal file
18
Task/Break-OO-privacy/C-sharp/break-oo-privacy-1.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
public class MyClass
|
||||
{
|
||||
private int answer = 42;
|
||||
}
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
var myInstance = new MyClass();
|
||||
var fieldInfo = typeof(MyClass).GetField("answer", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var answer = fieldInfo.GetValue(myInstance);
|
||||
Console.WriteLine(answer);
|
||||
}
|
||||
}
|
||||
1
Task/Break-OO-privacy/C-sharp/break-oo-privacy-2.cs
Normal file
1
Task/Break-OO-privacy/C-sharp/break-oo-privacy-2.cs
Normal file
|
|
@ -0,0 +1 @@
|
|||
42
|
||||
Loading…
Add table
Add a link
Reference in a new issue