import java.text.*;
import java.util.*;
class Eveniment {
private date dataInceput, dataSfarsit;
// Primeste 2 stringuri in format yyyy-MM-dd HH:mm:ss reprezentand data si ora
// de inceput si de final a evenimentului si inca un string care contine numele
// cu care apare evenimentul in calendar
try {
this.dataInceput = format.parse(dataInceput);
this.dataSfarsit = format.parse(dataSfarsit);
system.
out.
println("Data nu este in formatul cerut!");
}
this.nume = nume;
}
public date getDataInceput
() {
return dataInceput;
}
public date getDataSfarsit
() {
return dataSfarsit;
}
return nume;
}
}
class EvenimentRecurent extends Eveniment {
private int hours, hour, times;
super(dataInceput, dataSfarsit, nume);
hours = numarOre;
}
try {
nDate = newDate.parse(nextEvent);
nEvent = newDate.format(CalendarToDate(dateToCalendar(nDate)));
system.
out.
println("Data nu este in formatul cerut!");
}
return nEvent;
}
inputCal.setTime(event);
startingCal.setTime(getDataInceput());
while (startingCal.compareTo(inputCal) < 0) {
startingCal.
add(calendar.
HOUR_OF_DAY, hours
);
}
return startingCal;
}
return calendar.getTime();
}
}
public class Main {
public static void main
(string[] args
) {
EvenimentRecurent er = new EvenimentRecurent("2019-03-09 22:46:00","2019-03-09 23:00:00", "Scris probleme", 24);
system.
out.
println(er.
urmatorulEveniment("2019-04-19 22:46:23"));
}
}