i am fairly new to java so was wondering if i could get some basic help.
I have a class called Timetable
public class Timetable
{ private String Month;
private String Day;
private int[] times;
public Timetable(String month, String Day, int[] times)
{
this.month = month;
this.day = day;
//initalize various times..
This class relates to another class(LinkedList) of Timetables that adds the month,day and times. like this..
Add(new Timetable("May","Monday", **???**));
now i need to add the times that are in an array and vary such as {1,2,3,4} or {2,4,9} and there are only int[4] indexes.
Any Suggestions of how i initialize the times and pass the int[] times to the create the timetable??
Additionally to the other answers you could also adapt your constructor signature to
The usage within your Timetable class would remain the same (the
int...argument is mapped to an array ofints) but the advantage would be that the calls would be simplified to