Given the point class and point array how would you make the
Given the point class and point array, how would you make the first element of the array reference a Point object?
| points(new Point(1.0,2.0)); |
Solution
Given the point class and point array, how would you make the first element of the array reference a Point object?
points(new Point(1.0,2.0));
points = new Point(1.0,2.0);
points[0] = (1.0,2.0);
points[0] = new Point(1.0,2.0);
Ans: points[0] = new Point(1.0, 2.0);
points[0] => points first element of points array
To create an Object of Point class: use \'new\' operator with appropriate constructor
