/*
* Main.java
*
* Myint Java application
*
* Created on 02-05-2012 08:46 PM
*/
class CMyint
{
private int n;
public CMyint(int i)
{
System.out.println("CMyint("+ i+")");
n=i;
}
public CMyint(CMyint other)
{
System.out.println("CMyint(CMyint other)"+other.n);
n=other.n;
}
}
public class Main{
public static void main(String[] args) {
CMyint obj=new CMyint(3);
CMyint obj2=new CMyint(obj);
}
}
输出:
CMyint(3)
CMyint(CMyint other)3
public class Main{
public static void main(String[] args) {
CMyint obj=new CMyint(3);
//CMyint obj2=new CMyint(obj);
}
}
输出:
CMyint(3)