Question: Java Programming Help!!! Why is it giving me error on BlueJ? import java.util.ArrayList; import java.util.Iterator; import java.util.Collections; import java.util.Random; /** * Write a description of

Java Programming Help!!! Why is it giving me error on BlueJ?

import java.util.ArrayList;

import java.util.Iterator;

import java.util.Collections;

import java.util.Random;

/**

* Write a description of class AppointmentBook here.

*

* @author ()

* @version 1

*/

public class AppointmentBook {

// instance variables - replace the example below with your own

ArrayList dateList;

/**

* Constructor for objects of class AppointmentBook

*/

public AppointmentBook()

{

// initialise instance variables

dateList = new ArrayList<>();

}

public void addDate(Date d)

{

dateList.add(d);

}

public int removeDate(int index)

{

dateList.remove(index);

return index;

}

public void reverseOrder()

{

Collections.reverse(dateList);

}

public void removeDates(int month)

{

Random rand = new Random();

Date nextDate = rand.nextInt();

Iterator it = dateList.iterator();

while(it.hasNext())

{

nextDate = it.next();

if(month = nextDate.getMonth())

{

dateList.remove(index);

}

}

}

public void printAppointments()

{

for(Date Date: dateList)

{

System.out.println(Date.getMonth() + "/" + Date.getDay() + "/" + Date.getYear());

}

}

}

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!