Created
February 23, 2014 17:19
-
-
Save SpringMT/9174289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class TestA | |
{ | |
public int publicHoge; | |
private int privateHoge; | |
protected int protectedHoge; | |
void BaseHoge() | |
{ | |
publicHoge = 1; | |
privateHoge = 2; | |
protectedHoge = 3; | |
} | |
} | |
class TestB : TestA | |
{ | |
void DerivedHoge() | |
{ | |
publicHoge = 11; | |
privateHoge = 22; | |
protectedHoge = 33; | |
} | |
} | |
class TestC | |
{ | |
static void Main() | |
{ | |
TestA b = new TestA(); | |
Console.WriteLine(b.publicHoge); | |
Console.WriteLine(b.privateHoge); | |
Console.WriteLine(b.protectedHoge); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment