⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 java中的指针,引用及对象的clone.htm

📁 javn的Java书籍JAVA集合框架.rar我看过了是很有帮助的
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0068)http://www-900.ibm.com/developerWorks/cn/java/l-jpointer/index.shtml -->
<HTML 
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>JAVA中的指针,引用及对象的clone</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GB2312">
<META content="developerWorks 中国网站" name=TITLE>
<META content=papers_html name=dWCategory>
<META content=Java name=zone><!-- Java technology -->
<META content="[put paper-unique keywords here]" name=KEYWORDS>
<META 
content=Java语言的一个优点就是取消了指针的概念,但也导致了许多程序员在编程中常常忽略了对象与引用的区别,本文会试图澄清这一概念。并且由于Java不能通过简单的赋值来解决对象复制的问题,在开发过程中,也常常要要应用clone()方法来复制对象。本文会让你了解什么是影子clone与深度clone,认识它们的区别、优点及缺点。 
name=ABSTRACT>
<META 
content=Java语言的一个优点就是取消了指针的概念,但也导致了许多程序员在编程中常常忽略了对象与引用的区别,本文会试图澄清这一概念。并且由于Java不能通过简单的赋值来解决对象复制的问题,在开发过程中,也常常要要应用clone()方法来复制对象。本文会让你了解什么是影子clone与深度clone,认识它们的区别、优点及缺点。 
name=DESCRIPTION>
<META 
content="java tutorials, java training, java help, java standards, java code, java resources, java programming, java how to, components, beans, java beans, jdk, jugs, java user groups" 
name=KEYWORDS>
<META content=/developerWorks/cn/cncontent.nsf/cn_dW_feedback name=OWNER>
<META content="2001**** initials" name=LASTUPDATE>
<META content=Public name=SECURITY>
<META content=text/xhtml name=FORMAT>
<META content="Copyright (c) 2000 by IBM Corporation" name=COPYRIGHT>
<META content=index,follow name=ROBOTS>
<META content=cn name=IBM.Country>
<META name=DOCUMENTCOUNTRYCODE value="us">
<META name=DOCUMENTLANGUAGECODE value="en">
<META http-equiv=PICS-Label 
content='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" by "webmaster@mail.software.ibm.com" for "http://www.ibm.com/software" on "1997.08.13T17:59-0800" r (n 0 s 0 v 0 l 0))'>
<META http-equiv=Expires content=0>
<SCRIPT language=JavaScript src="JAVA中的指针,引用及对象的clone.files/style.js" 
type=text/javascript></SCRIPT>

<SCRIPT language=JavaScript src="JAVA中的指针,引用及对象的clone.files/spinbox.js" 
type=text/javascript></SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=2 topMargin=2 marginwidth="2" marginheight="2"><!-- MASTHEAD -->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD class=tbgc width=160><A 
      href="http://www-900.ibm.com/developerWorks/cn/cgi-bin/click.cgi?url=www.ibm.com/cn/&amp;origin=dwheader"><IMG 
      height=47 alt=IBM src="JAVA中的指针,引用及对象的clone.files/ibm-logo.gif" width=160 
      border=0></A></TD>
    <TD class=tbg width=70><FONT color=#99ccff size=2><B>China</B></FONT><A 
      href="http://www-900.ibm.com/developerWorks/cn/java/l-jpointer/index.shtml#main"><IMG 
      height=1 alt="Skip to main content" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
      width=70 border=0></A></TD>
    <TD class=tbgc vAlign=top align=right width="100%">
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <FORM id=form1 name=form1 
        action=http://www-128.ibm.com/developerworks/search/searchResults.jsp 
        method=get>
        <TBODY>
        <TR>
          <TD colSpan=7><IMG height=4 alt="" 
            src="JAVA中的指针,引用及对象的clone.files/c.gif" width=390 border=0></TD></TR>
        <TR vAlign=center>
          <TD class=dwsearch><NOBR><FONT 
            color=#ffffff><B>搜索:</B></FONT></NOBR>&nbsp;&nbsp;</TD>
          <TD><INPUT class=dwsearch maxLength=100 size=23 name=query></TD>
          <TD class=dwsearch vAlign=center>&nbsp;<FONT 
            color=#ffffff><B>在</B></FONT>&nbsp;</TD>
          <TD class=dwsearch><SELECT class=dwsearch2 
              name=searchScope>&nbsp;&nbsp; <OPTION value=dW selected>dW 
              全部内容</OPTION> <OPTION value=javaZ>&nbsp;Java 技术</OPTION> <OPTION 
              value=linuxZ>&nbsp;Linux</OPTION> <OPTION 
              value=opensrcZ>&nbsp;开放源码</OPTION> <OPTION 
              value=securityZ>&nbsp;安全</OPTION> <OPTION value=webservZ>&nbsp;Web 
              服务</OPTION> <OPTION value=xmlZ>&nbsp;XML</OPTION> <OPTION 
              value=dW>.................</OPTION> <OPTION 
              value=dmdd>&nbsp;DB2</OPTION> <OPTION 
              value=wsdd>&nbsp;WebSphere</OPTION> <OPTION 
              value=lotusdd>&nbsp;Lotus 专题</OPTION> <OPTION 
              value=tivolidd>&nbsp;Tivoli 专题</OPTION> <OPTION 
              value=dW>.................</OPTION> <OPTION value=all>IBM 
              全部内容</OPTION></SELECT></TD>
          <TD><IMG height=1 alt="" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
            width=5 border=0></TD>
          <TD><INPUT type=image height=23 alt="Search button" width=64 
            src="JAVA中的指针,引用及对象的clone.files/search.gif" value=Search border=0 
            name=Search></TD>
          <TD vAlign=top><IMG height=1 alt="" 
            src="JAVA中的指针,引用及对象的clone.files/c.gif" width=30 border=0></TD></TR>
        <TR vAlign=top>
          <TD>&nbsp;</TD>
          <TD class=dwsearch>&nbsp;<FONT color=#ffffff>只用 + - "&nbsp;" 
            (&nbsp;)</FONT>
          <TD>&nbsp;</TD>
          <TD>&nbsp;</TD>
          <TD>&nbsp;</TD>
          <TD>&nbsp;</TD>
          <TD>&nbsp;</TD></TR><INPUT type=hidden value=1 name=searchType> <INPUT 
        type=hidden value=dWChina name=searchSite> <INPUT type=hidden value=zh 
        name=pageLang> <INPUT type=hidden value=gb2312 name=langEncoding> 
        </FORM></TBODY></TABLE></TD></TR><A id=main name=main>
  <TR>
    <TD class=hbg width=160 height=21>&nbsp;</TD>
    <TD class=bbg vAlign=top colSpan=2 height=21>&nbsp;&nbsp;&nbsp; <A 
      class=mainlink 
      href="http://www-900.ibm.com/developerWorks/cn/cgi-bin/click.cgi?url=www-900.ibm.com/cn/&amp;origin=dwhead">IBM 
      主页</A> <SPAN class=divider>&nbsp;&nbsp;|&nbsp;&nbsp;</SPAN> <A 
      class=mainlink 
      href="http://www-900.ibm.com/developerWorks/cn/cgi-bin/click.cgi?url=www-900.ibm.com/cn/products/index.shtml&amp;origin=dwhead">产品与服务</A> 
      <SPAN class=divider>&nbsp;&nbsp;|&nbsp;&nbsp;</SPAN> <A class=mainlink 
      href="http://www-900.ibm.com/developerWorks/cn/cgi-bin/click.cgi?url=www-900.ibm.com/cn/support/index.shtml&amp;origin=dwhead">支持与下载</A> 
      <SPAN class=divider>&nbsp;&nbsp;|&nbsp;&nbsp;</SPAN> <A class=mainlink 
      href="http://www-900.ibm.com/developerWorks/cn/cgi-bin/click.cgi?url=www-900.ibm.com/cn/account/index.shtml&amp;origin=dwhead">个性化服务</A></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR class=hil>
    <TD width="100%" height=1><IMG height=1 alt="" 
      src="JAVA中的指针,引用及对象的clone.files/c.gif" width=592></TD></TR>
  <TR class=dwr1>
    <TD width="100%" height=2><IMG height=2 alt="" 
      src="JAVA中的指针,引用及对象的clone.files/c.gif" width=592></TD></TR>
  <TR class=dwg3>
    <TD width="100%" height=1><IMG height=1 alt="" 
      src="JAVA中的指针,引用及对象的clone.files/c.gif" width=592></TD></TR>
  <TR class=bbg>
    <TD width="100%" height=1><IMG height=1 alt="" 
      src="JAVA中的指针,引用及对象的clone.files/c.gif" width=592></TD></TR>
  <TR class=hil>
    <TD width="100%" height=1><IMG height=1 alt="" 
      src="JAVA中的指针,引用及对象的clone.files/c.gif" width=592></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR vAlign=top>
    <TD width=5><IMG height=1 alt="" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
      width=5 border=0></TD>
    <TD width="100%">
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR vAlign=top>
          <TD width="100%"><IMG height=4 alt="" 
            src="JAVA中的指针,引用及对象的clone.files/c.gif" width=2 border=0><BR><B><A 
            href="http://www-900.ibm.com/developerWorks/cn/index.shtml">developerWorks 
            中国网站</A> : <A 
            href="http://www-900.ibm.com/developerWorks/cn/java/index.shtml">Java</A> 
            : <A 
            href="http://www-900.ibm.com/developerWorks/cn/cnpapers.nsf/java-papers-bynewest?OpenView&amp;count=10">所有的文章 
            </A></B></TD>
          <TD align=right width=136><A 
            href="http://www-900.ibm.com/developerWorks/cn/index.shtml"><IMG 
            height=24 alt="developerWorks 中国网站" 
            src="JAVA中的指针,引用及对象的clone.files/dwlogo-small.gif" width=136 
            border=0></A></TD>
          <TD width=5><IMG height=1 alt="" 
            src="JAVA中的指针,引用及对象的clone.files/c.gif" width=5 
        border=0></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!-- Title Area -->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR vAlign=top>
    <TD colSpan=5><IMG height=15 alt="" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
      width=5 border=0></TD></TR>
  <TR vAlign=top>
    <TD width=2><IMG height=1 alt="" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
      width=2 border=0></TD>
    <TD><!-- <span class="astitle">[Series title]:</span> --><SPAN 
      class=atitle>JAVA中的指针,引用及对象的clone</SPAN></TD>
    <TD width=8><IMG height=1 alt="" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
      width=8 border=0></TD>
    <TD width=6><IMG height=1 alt="" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
      width=6 border=0></TD></TR><!-- Black line separator -->
  <TR vAlign=top>
    <TD bgColor=#000000 colSpan=5><IMG height=1 alt="" 
      src="JAVA中的指针,引用及对象的clone.files/c.gif" width=100 border=0></TD></TR>
  <TR vAlign=top>
    <TD bgColor=#ffffff colSpan=5><IMG height=8 alt="" 
      src="JAVA中的指针,引用及对象的clone.files/c.gif" width=100 
border=0></TD></TR></TBODY></TABLE><!-- END HEADER AREA --><!-- START BODY AREA -->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR vAlign=top>
    <TD width=10><IMG height=1 alt="" src="JAVA中的指针,引用及对象的clone.files/c.gif" 
      width=10 border=0></TD>
    <TD width="100%">
      <TABLE cellSpacing=0 cellPadding=0 width=168 align=right border=0>
        <TBODY>
        <TR><!-- Sidebar Gutter -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -