Java疑惑点解析(二)

java中导入导出Excel文件 /** * @param args the command line arguments */ public static void main(String[] args) { //Excel2003文档的创建,即扩展名为.xls try { //创建一个工作簿 Workbook wb = new HSSFWorkbook(); CreationHelper createHelper = wb.getCreationHelper(); //创建两个工作表,sheet1和sheet2 Sheet sheet1 = wb.createSheet("sheet1"); Sheet sheet2 = wb.createSheet("sheet2"); // 在Excel工作表中插入一行数据 Row row = sheet1.createRow((short) 0);//此处数字为在第几行插入数据,0表示工作表第1行,1表示第2行,以此类推 // Create a cell and put a value in it. //创建一个单元并把数据写入,0表示第N行第1个单元格,1表示第N行第2个单元格 Cell cell = row.createCell(0);//此处为单元序号 cell.setCellValue("'001");//此处为数据 立即下载

        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




        用过C++的人都知道,C++中有个"拷贝构造函数"的概念。这个概念是为了解决C++中把一个对象指针赋值给另外一个对象指针,从而两个指针指向同一块内存区域而提出的。

       同样,Java做为一门高级语言,它也无法避免这样的问题。Java中没有"拷贝构造函数"的概念,而是提出了一个"Clone"的概念。其实现机制还是利用C++中的"深拷贝"进行的。

下面是两个例子程序,对比一下前后就很容易得出结论了。

使用Clone机制前:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main {
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main a = new Main();
        Main b = a;
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

使用Clone机制后:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午6:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testjavaclone;

/**
 *
 * @author df.sun
 */
public class Main implements Cloneable{
    private String name;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    void setName(String name)
    {
        this.name = name;
    }
   
    String getName()
    {
        return this.name;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
        Main a = new Main();
        Main b = (Main)a.clone();
       
        a.setName("aaa");
        b.setName("bbb");
       
        System.out.println(a.getName());
        System.out.println(b.getName());
    }
   
}

 

关于线程共享数据的问题。

程序1:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Thread a = new Thread(new Main());
        Thread b = new Thread(new Main());
        
        a.start();
        b.start();
    }
   
}

程序2:

/*
 * Main.java
 *
 * Created on 2007年8月4日, 下午7:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package testthread;

/**
 *
 * @author df.sun
 */
public class Main extends Thread{
   
    private int couter = 10;
    /** Creates a new instance of Main */
    public Main() {
    }
   
    public void run()
    {
        for(int i = 0;i < 10;i++)
        {
            couter--;
        }
        System.out.println(couter);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Main m = new Main();
        Thread a = new Thread(m);
        Thread b = new Thread(m);
       
        a.start();
        b.start();
    }
   
}




PX4(CUAV v6x 飞控)+ QAV250 机架无人机组装测试教学(无人机电机转向不对,如何反转电机?) 本文介绍无人机的组装与飞控调试:1.无人机的硬件组装。2.无人机飞控软件的下载,电机、遥控器、电调的校准与调试。 阅读详情

相关推荐

高通camx ThreadManager

m_pCore->AcceptNewJob是将一个Job或者任务插入一个Queue,有一个工作线程循环从Queue中取Job任务执行,执行任务就是回调任务中的callback函数,AcceptNewJob实现。调用AddToPriorityQueue将任务添加到queue任务队列,那么什么时候从这个queue中取任务执行呢?有个线程循环执行DoWork,最终调用checkAndDequeue取任务执行。

GetnextWindow的专栏 439

JDBC操作达梦数据库

JDBC(Java DataBase Connectivity)即java数据库连接,它是一种用于执行SQL语句的Java API,是由一组用Java语言编写的类和接口组成,其本质就是java官方提供的一套规范(接口)。用于帮助开发人员快速实现不同关系型数据库的连接;不同的数据库厂商,针对这套接口,提供不同的数据库驱动,即Java实现类;达梦为DM8版本提供的JDBC驱动DmJdbcDriver18.jar,DM7版本对应使用DmJdbcDriver17.jar....

weixin_61894388的博客 1万+

MEG预处理-Brainstorm

Brainstorm下载和安装 去Brainstorm官网进行下载:打开网页后,点击左侧Download;在跳出来的界面中进行简单的注册,注册完成后可以进行下载 解压后得到“brainstorm3”的文件夹,里面包含Brainstorm工具包的所有文件,把这个文件夹放在某个路径如"E:\matlab_tools\brainstorm3"即可 同样在某个路径建立空的文件夹命名为:brainstorm_db用于工具包运行过程中自动存储生成的文件,所以这个文件中生成的数据不要手动移动删除 在Matlab中,把.

AxeChen的博客 6127

java编程二十_Java语言程序设计(二十)编程练习

1.编写程序,读取一个在0到1000之间的整数,并将该整数的各位数字相加,例如,整数是999,结果输出27.程序清单如下:package sumsum;import java.util.Scanner;/**** @author mjd*/public class Sumsum {/*** @param args the command line arguments*/public static ...

weixin_42124743的博客 437

热测试芯片(TTC)在ASIC热设计中的关键作用与应用

热测试芯片(TTC)是半导体热管理领域的重要工具,通过物理仿真技术精确测量芯片温度分布。其核心原理是利用金属膜电阻和二极管传感器阵列,实现微米级空间分辨率和毫秒级动态响应。在工程实践中,TTC能有效预防热岛效应、优化散热设计,特别适用于AI加速芯片、3D堆叠封装等先进半导体器件。相比传统热仿真软件,TTC提供更真实的温度数据,帮助工程师在流片前发现潜在热问题。随着1mm微型单元技术的突破,TTC已能检测0.3mm²微小区域的热变化,满足GaN/SiC等宽禁带半导体器件的测试需求。

weixin_33688840的博客 509

Android手机免root玩转Kali NetHunter:Termux保姆级安装指南(附Kex VNC配置)

本文提供了一份详细的Android手机免root安装Kali NetHunter的保姆级指南。通过使用Termux终端模拟器,用户无需解锁Bootloader或获取root权限,即可在普通安卓设备上部署完整的Kali Linux渗透测试环境。教程涵盖了从环境准备、NetHunter核心安装到配置Kex VNC实现图形桌面访问的全过程,并附带了电脑投屏与常见问题解决方案,旨在打造一个便携的移动安全学习与测试平台。

weixin_29208327的博客 304

java程序翻译_Java 代码翻译

packagestringdemoapp;publicclassMain{publicstaticvoidmain(String[]args){//TODOcodeapplicationlogichereif(args.length>0){for(inti=0;ipackage stringdemoapp;public class Main{public static void main(S...

weixin_39868034的博客 783

博通PEX89000 PCIe 5.0交换芯片:如何为AI集群构建高效GPU互联架构

本文深入解析了博通PEX89000 PCIe 5.0交换芯片如何为AI集群构建高效的GPU互联架构。该芯片通过提供高带宽、低延迟的PCIe 5.0交换能力,打破传统GPU通信的带宽瓶颈,并支持多主机共享、资源池化及软件定义拓扑,从而显著提升大规模AI训练与推理任务的效率与资源利用率。

weixin_29214559的博客 413

关于Scanner中nextxxx()须注意的一点

public static void main(String[] args) { // TODO code application logic here Scanner s = new Scanner(System.in); //需要注意的是,如果在通过nextInt()读取了整数后,再接着读取字符串,读出来的是

PBB的博客 704

5G NR LDPC码(2)—— 从基图到速率匹配:解码5G高速数据信道的标准化设计

本文深入解析了5G NR LDPC码的标准化设计流程。从作为核心骨架的基图(BG1/BG2)出发,详细阐述了其如何通过扩展因子Z灵活生成实际校验矩阵,并协同传输块大小计算与分段策略。文章重点剖析了基于循环缓存和冗余版本的速率匹配机制,以及其如何高效支撑增量冗余混合自动重传请求,从而确保5G高速数据信道在复杂环境下的可靠与高效传输。

weixin_29206669的博客 273

SORT算法在遮挡下总跟丢?深入OC-SORT源码,拆解其三大创新点如何解决卡尔曼滤波的顽疾

本文深入解析OC-SORT算法如何通过三大创新点解决多目标跟踪中的卡尔曼滤波顽疾。OC-SORT引入在线平滑虚拟轨迹技术(OOS)、观测中心动量匹配机制(OCM)和基于最后观测的轨迹恢复(OCR),显著提升了遮挡场景下的跟踪性能。实验数据显示,相比传统SORT算法,OC-SORT在MOT17数据集上MOTA提升5.7%,遮挡恢复成功率提高64.2%,为Multi-Object Tracking领域带来突破性进展。

weixin_42547431的博客 242
上一篇: 汇编中一个有趣的问题
下一篇: Symbian中的iScanCode和iCode
techweb
博客等级 码龄19年 226粉丝 3842原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值