Skip to content

Copy constructors or clone()? #20

@Makman2

Description

@Makman2

Nearly all classes lack the capability of copying. There are two options:

  1. Use copy constructors.
    • Advantage: Type-safe, no castings needed
  2. clone():
    • Advantages: Java conform, works together with other components. Especially every Object has a clone-function.
    • (big) Disadvantage: Annoying implementation, involves many casts and a try-catch. Not really efficient.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions