//Activity.java

class Activity
{
    public String name;
    public int startTime;  // start hour in the range [0, 23]
    public int finishTime; // finish hour in the range [0, 23]

    public Activity
    (
        String activityName,
        int initialStartTime,
        int initialFinishTime
    )
    {
        name = activityName;
        startTime = initialStartTime;
        finishTime = initialFinishTime;
    }

    public boolean conflictsWith(Activity otherActivity)
    {
        // No conflict exists if this activity's finishTime comes
        // at or before the other activity's startTime
        if (finishTime <= otherActivity.startTime)
        {
            return false;
        }

        // No conflict exists if the other activity's finishTime
        // comes at or before this activity's startTime
        else if (otherActivity.finishTime <= startTime)
        {
            return false;
        }

        // In all other cases the two activities conflict with each other
        return true;
    }
}

