Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 有关克隆的问题
xingchao





发贴: 32
积分: 0
于 2006-11-15 16:57 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
请大家帮帮忙解决个问题
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);
   }
}
这个程序中 在编译时 报错 “不兼容的类型” 第六行
这是怎么回事啊? 希望大家多多指点!




话题树型展开
人气 标题 作者 字数 发贴时间
5435 有关克隆的问题 xingchao 680 2006-11-15 16:57
3975 Re:有关克隆的问题 stonefeng 54 2006-12-11 22:23
3927 Re:有关克隆的问题 focus 53 2006-12-12 16:24
3934 Re:有关克隆的问题 cxp108 68 2006-12-13 08:42
4065 Re:有关克隆的问题 stonefeng 184 2006-12-13 21:36

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923