Here you can find the source of getNextDayOfweek()
public static int getNextDayOfweek()
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { private static Date date = new Date(); public static int getNextDayOfweek() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new java.util.Date(date.getTime() + 24 * 60 * 60 * 1000)); if (calendar.get(Calendar.DAY_OF_WEEK) == 1) return 7; else/*w ww . ja va 2s. c om*/ return calendar.get(Calendar.DAY_OF_WEEK) - 1; } }