Multiple Choice
What do you lose when you add a constructor to a class?
What is the most correct description of a constructor?
How do we call the constructor depicted in the code snippet below?
public class Point { private double x; private double y; // ... public Point(Point original) { this(original.x, original.y); } }
Which code block contains a default constructor?
// Code block A class Foo { public Bar() { // ... } }
// Code block B class Bar { public Bar(int x) { // ... } }
// Code block C class Bar { public Foo(int x) { // ... } }
// Code block D class Bar { public Bar() { // ... } }
Last updated