Question: in Java, 39) Code a constructor for the Date described below. The constructor has three arguments: public class Date { private int month; // 1-12

in Java,

39) Code a constructor for the Date described below. The constructor has three arguments:

public class Date

{

private int month; // 1-12

private int day; // 1-31 based on month

public int Year ;

// constructor: use property Month to confirm proper value for month;

// use property Day to confirm proper value for day

}

40. Given the class Vector3 as coded below and the constructor Vector3 with the header shown. Demonstrate the use of this keyword within the constructor code?

class Vector3

{

float x;

float y;

float z;

public Vector3 (float x, float y, float z)

Answer

public Vector3 (float x, float y, float z)

{

//put your answer here

}

}

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!