已知如下代码: 1: class Example{ 2: String str; 3: public Example(){ 4: str= "example"; 5: } 6: public Example(String s){ 7: str=s; 8: } 9:} } 10: class Demo extends Example{ 11: } 12: public class Test{ 13:public void f () { 14:Example ex = new Example("Good"); 15:Demo d = new Demo("Good"); 16:} }