Question: NAME CSC 1 6 2 - Classes & Objects HW 1 Consider the definition of the following class: public class CC { private int u

NAME
CSC 162-Classes & Objects HW 1
Consider the definition of the following class:
public class CC
{
private int u;
private int v,
private double w;
public CC()
??? Line 1
{dots}
public CC(int a)
??? Line 2
{dots}
public int a, int b)
??? Line 3
{dots}
public CC(int a, int b, double d)//Line 4
{dots}
a. Give the line number containing the constructor that is executed in each of the following
declarations:
(i)CC one = new CC();
(ii)CC two = new CC(5,6);
(iii)CC three = new CC(2,8,3.5);
b. Write the definition of the constructor in Line 1 so that the instance variables are
initialized to 0.
 NAME CSC 162-Classes & Objects HW 1 Consider the definition of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!