How to get number of days in month java code, Examples?

public static int getNoOfDays(int month, int year){
    Calendar calendar = Calendar.getInstance();
    int date = 1;
    calendar.set(year, month, date);
    int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    return days;

Popular posts from this blog

What is NBioBSP Java Library?

Draw arrow line example

Capture image from webcam java code, examples