What is true about clone?()A. It would be a completely new way of making a human beingB.It, biologically, refers to any organism whose genetic information is identical to that of its parent organism from which it is createdC.Cloning will create a baby fro

题目
What is true about clone?()

A. It would be a completely new way of making a human being

B.It, biologically, refers to any organism whose genetic information is identical to that of its parent organism from which it is created

C.Cloning will create a baby from a single cell, from a single person

D.It is favored widely


相似考题
参考答案和解析
正确答案:ABC
更多“What is true about clone?() ”相关问题
  • 第1题:

    A:What’s the extent of the delay? B: ( )

    A.BeiJing

    B.apron

    C.About 2 hours

    D.bullet


    正确答案:C

  • 第2题:

    Clone 和Duplicate 之间的区别是()

    A. Clone 复制出来的对象完全相同,位置也相同,Duplicate 复制出的对象位置有一点错开

    B. Clone 复制出的对象完全相同,位置有点错开,Duplicate 复制出来的对象位置也相同

    C. Clone 可以重复粘贴,其他都相同

    D. Duplicate 可以重复粘贴,其他都相同


    答案:A

  • 第3题:

    19、以下关于Java语言中clone()方法的使用错误的是()。

    A.对于任何对象x,都有x.clone()==x

    B.对于任何对象x,都有x.clone().getClass()==x.getClass()

    C.在子类的clone()方法中可以通过调用super.clone()来实现自我复制

    D.支持浅克隆的类必须实现Cloneable接口,否则将抛出CloneNotSupportedException异常


    A

  • 第4题:

    clone()方法时,通常都有一行代码,是什么?


    在实际编程过程中,我们常常要遇到这种情况:有一个对象A,在某一时刻A中已经包含了一些有效值,此时可能会需要一个和A完全相同新对象B,并且此后对B任何改动都不会影响到A中的值,也就是说,AB是两个独立的对象,但B的初始值是由A对象确定的。Clone 有缺省行为,super.clone();他负责产生正确大小的空间并逐位复制。使用clone()来复制一个对象,clone()Object类继承。所有具有clone功能的类都有一个特性,那就是它直接或间接地实现了Cloneable接口。

    protected native Object clone() throws CloneNotSupportedException;

    可以看出它是一个protected方法,所以我们不能简单地调用它;关键字native,表明这个方法使用java以外的语言实现。

    对于object  x,

    x.clone() != x

    x.clone().getClass() == x.getClass()

    x.clone().equals(x)

    以上返回的值都为true 

    要说明的有两点:一是拷贝对象返回的是一个新对象,而不是一个引用二是拷贝对象与用new操作符返回的新对象的区别就是这个拷贝已经包含了一些原来对象的信息,而不是对象的初始信息。

    1.浅复制与深复制概念

    ⑴浅复制(浅克隆):被复制对象的所有变量都含有与原来的对象相同的值,而所有的对其他对象的引用仍然指向原来的对象。换言之,浅复制仅仅复制所考虑的对象,而不复制它所引用的对象。

    ⑵深复制(深克隆)

    被复制对象的所有变量都含有与原来的对象相同的值,除去那些引用其他对象的变量。那些引用其他对象的变量将指向被复制过的新对象,而不再是原有的那些被引用的对象。换言之,深复制把要复制的对象所引用的对象都复制了一遍。

    public class TestClone1implements Cloneable{

         int count;

         TestClone1 next;

         public TestClone1(int count) {

              this.count=count;

              if(count>0)

                   next=new TestClone1(count-1);

         }

         void add(){

              count++;

              if(next!=null)

              next.count++;

         }

         public String toString(){

              String s=String.valueOf(count)+" ";

              if(next!=null)

              s+=next.toString();

              return s;

         }

         public Object clone(){

              Object o=null;    

              try{

              o=super.clone();//如果没有实现cloneable,将会抛出CloneNotSupported异常

              }

              catch(CloneNotSupportedException e){

              System.err.println("cannot clone");

              }

              return o;

         }

         public static void main(String[] args){

              TestClone1 t=new TestClone1(1);

              System.out.println("t="+t);

              TestClone1 t1=(TestClone1)t.clone();

              System.out.println("t1="+t1);

              t.add();

              System.out.println("after added/nt t="+t+"/nt1="+t1)

        }

    }

    在这个例子中创建t相当于两个相连的TestClone1实例,而在调用了t的add方法之后,意想不到的结果出现了: 

    t=1 0

    t1=1 0

    after added

    t t=2 1

    t1=1 1

    t1也发生了改变。实际上Object.clone()进行的复制有着"bitwise"原则,也就是逐位复制。对于一个对象中定义的对象,它只是简单的复制这个对象的引用。这也就是常说的浅层拷贝(shallow copy)。想要执行深层拷贝(deep copy),只需要在TestClone1 t1=(TestClone1)t.clone();后面加上t1.next=(TestClone1)t.next.clone();就能得到:

    t=1 0

    t1=1 0

    after added

    t t=2 1

    t1=1 0

    这个正确的结果。

     

  • 第5题:

    资料:We never thought we'd say this, but we'd welcome back some chilly weather.
    A cool mass of air heads toward the United States from the upper regions of Canada and Alaska this week, according to the National Weather Service.
    According to the NWS, a mass of cold air will drop from the Arctic regions to Canada and then the upper Midwest next week.
    Temperatures across the Midwest will drop into the 60s and 70s—a sharp difference from the 80 degree and 90 degree temperatures from recent weeks. And the relatively cooler air may be felt as far East as New York and Washington.
    The cool breezes may be a welcome relief this time around, but remember the last few times we got hit with Arctic air?
    Temperatures in cities including Chicago, Cleveland, New York, and Louisville fell into single-digit and negative territory for long stretches during the harsh winter months of early 2014. But we're sure you remember.

    What’s the temperature when the report was written?

    A.About 60s and 70s.
    B.Between 60s and 90s.
    C.Below 60s.
    D.About 80s and 90s.

    答案:D
    解析:
    本题考查的是细节理解。
    【关键词】temperature;when the report was written
    【主题句】Temperatures across the Midwest will drop into the 60s and 70s—a sharp difference from the 80 degree and 90 degree temperatures from recent weeks. 中西部地区的气温将下降到60-70华氏度,与最近几周的80-90华氏度的温度有很大的不同。
    【解析】本题的问题是“写这篇报道时气温是多少?”。选项A意为“约为60-70华氏度”;选项B意为“为60和90华氏度之间”;选项C意为“华氏60度以下”;选项D 意为“约为80和90华氏度”。根据题目中关键词找到主题句,结合主题句故选D。

  • 第6题:

    下面代码运行后将克隆产生一个页面可见的div新对象 var cloneObject = $("div").clone(true);


    BC