Created by
Ettar
last modified
| public class TestObject {
private int testInt;
private String testString;
public TestObject(int testInt,String testString){
setTestInt(testInt);
setTestString(testString);
}
public TestObject(TestObject other){
setTestString(other.getTestString());
setTestInt(other.getTestInt());
}
public int getTestInt() {
return testInt;
}
public String getTestString() {
return testString;
}
public void setTestInt(int testInt) {
this.testInt = testInt;
}
public void setTestString(String testString) {
this.testString = testString;
}
}
|
| public class mainClass {
public static void main(String[] ARGS){
TestObject t1=new TestObject(1,"abc");
TestObject tk = new TestObject(t1.getTestInt(),t1.getTestString());
TestObject ntk = t1;
TestObject tk2 = new TestObject(t1);
System.out.println();
}
}
|