Greetings,
I have classes called 'Date' and 'Information'. In date class i have defined how date should be stored as well as in Information. However, when i create an object using (BlueJ) Information, the stored date in the information class does not seem to transfer the details to the Date class, which it should be doing. To clarify what i mean, here are the codes;
Information (code)
public class Information
{
private int reference;
private String name;
private Date Date;
public Information(int ref, String nam)
{
reference = ref;
name = nam;
Date = null; //date should be stored as null unless user sets the date manually.
}
public void setDateRequired(int day, int month, int year)
{
Date = new Date(day, month, year);
}
Date
public class Date
{
/** Fields of a Date - just the day, month and year*/
private int day;
private int month;
private int year;
/**
* Constructor for objects of class Date, sets a default date of 1/1/2000
*/
public Date()
{
day = 1;
month = 1;
year = 2000;
}
/**
* Constructor for objects of class Date
* @param d - the day part of the date (1 - 31, depending on the month).
* @param m - the month part of the date (1 - 12).
* @param y - the year part of the date.
*/
public Date(int d, int m, int y)
{
day = d;
month = m;
year = y;
}
Could anyone please tell me what I' am doing wrong?

There are no interaction between the two classes nor objects.