I want to equalize two object like this:
public abstract class Shape{...} // There is an abstract shape class
public class Circle extends Shape {
int radius;
...
}
public class ColoredCircle extends Circle{
Color color;
public ColoredClass(Circle circle) {
this = circle; // This line has a problem.
this.color = Color.RED;
}
}
How can i copy all fields to sub-class with current values?