how to get the first day of week in java

www.‮uttual‬ri.com
how to get the first day of week in java
/**
 * @author lautturi.com 
 * Java example: get first day of the week in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		Date date = new Date();
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		calendar.set(Calendar.DAY_OF_WEEK, 1);
		Date firstdateofweek = calendar.getTime();
		System.out.println(firstdateofweek);
	}

}
Created Time:2017-09-23 19:29:24  Author:lautturi