copy constructor

1 topic · 1 source

Technology› Programming

Java

A constructor taking a single argument of the same class. For instance

 public class Point { // Use p's attributes to initialize this object. public Point(Point p){ ... } ... } 
The argument is used to define the initial values of the new object's attributes.

Cite this definition

APA
MLA
Chicago