thanks for your answer,you are right, will catch exception here.it should be .then I get the result is val==3(this peoperty is belong to MyObject2);I just want to know whether could I get the MyObject1 property 'testNumber';
it is not about real-world applicability,it's just my curiosity.so if no solution,it's doesn't matter.sorry,I am not good at english,must have some english syntax error above. please pardon me.
posted 7 years ago
I knew the answer.
just save the 'new MyObject1( 8 )',then I can get the property of MyObject1;
I am so careless;