It's not duplicated because the other topic does not provide any suitable answer for my case. I can't use any serializers or other libraries like they advise.
class A {
Object obj;
String s;
}
What is the proper way to define a copy constructor for such class? I know how to 'deal' with String type, but what about the 'Object' class? It does not provide new Object(obj) constructor, also it does not have .clone() method.
class A {
A(A a) {
this.s = new String(a.s);
this.obj = //???
}