I'm trying the class Calendar in java, I made a class that returns the current time and minutes, when I ask for the first time the current minutes work, but when I do the second the minutes do not change, for example I execute the method to 12:35, then I execute it at 12:36 and even then it keeps returning 35 as the current minute.
this is the code:
import java.util.Calendar;
public class HoraActual
{
static Calendar now = Calendar.getInstance();
public static int getHora(){
return now.get(Calendar.HOUR);
}
public static int getMinutos(){
return now.get(Calendar.MINUTE);
}
}