All pastes #871576 Raw Edit

robin

public text v1 · immutable
#871576 ·published 2008-01-25 01:14 UTC
rendered paste body
using System;
namespace ConsoleApp
{
	class A {
		protected static string a;
		public static void test() {
			A.a = "A::a";
			Console.WriteLine(A.a + "\n");	// Prints 'A::a'.
			Console.WriteLine(B.a + "\n");  // Prints nothing. B.a is a separate entity from A.a (unlike in PHP - see: http://pastebin.ca/871556)
		}
	}
	class B:A {
		public static string a;
	}

	class MyApp {
		static void Main(string[] args)	{
			A.test();
		}
	}
}