xingchao
发贴: 32
积分: 0
|
于 2006-11-15 16:57
请大家帮帮忙解决个问题 package questions.c2; public class Debug2_2 implements Cloneable{ StringBuffer sb=new StringBuffer("Salse Report for"); public Debug2_2 clone() throws CloneNotSupportedException{ Debug2_2 result=super.clone(); result.sb=new StringBuffer(this.sb.toString()); return result; } public static void main(String[] args) throws CloneNotSupportedException{ Debug2_2 x=new Debug2_2(); Debug2_2 y=x.clone(); x.sb.append("October"); System.out.println(y.sb); } } 这个程序中 在编译时 报错 “不兼容的类型” 第六行 这是怎么回事啊? 希望大家多多指点!
|