java 程序 哪句有错误??
1:classExample{2:Stringstr;3:publicExample(){4:str="example";5:}6:publicExample(Strin...
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:} }
为什么???? 展开
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:} }
为什么???? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询