Skip to content

Instantly share code, notes, and snippets.

@SpringMT
Created February 23, 2014 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpringMT/9174289 to your computer and use it in GitHub Desktop.
Save SpringMT/9174289 to your computer and use it in GitHub Desktop.
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