Created
July 6, 2013 11:13
-
-
Save kingsamchen/5939601 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
//// C# | |
class SeqTest | |
{ | |
string _inClassName; | |
public string InClassName | |
{ | |
get {return _inClassName;} | |
set {_inClassName = value;} | |
} | |
public SeqTest(string className) | |
{ | |
InClassName = className; | |
Console.WriteLine("In " + InClassName); | |
} | |
} | |
class Person | |
{ | |
public SeqTest test = new SeqTest("Person"); | |
public string Name | |
{ | |
get; | |
set; | |
} | |
public int Age | |
{ | |
get; | |
set; | |
} | |
} | |
class Employer : Person | |
{ | |
public SeqTest another = new SeqTest("Employer"); | |
} | |
///// C++ | |
class SeqTest | |
{ | |
public: | |
SeqTest() | |
{ | |
} | |
SeqTest(const char* className) | |
{ | |
cout<<"In "<<className<<endl; | |
} | |
}; | |
class Foo | |
{ | |
public: | |
Foo() : seq("Foo") | |
{ | |
} | |
private: | |
SeqTest seq; | |
}; | |
class FooF : public Foo | |
{ | |
public: | |
FooF() : another("FooF") | |
{ | |
} | |
private: | |
SeqTest another; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment