get the day of week in java

http‮//:s‬www.lautturi.com
get the day of week in java
/**
 * @author lautturi.com 
 * Java example: Get the day number in a week in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		Calendar cal = Calendar.getInstance();
		int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
		System.out.println(dayOfWeek);

	}
}

output:

1

1==> sunday

Created Time:2017-09-24 22:16:52  Author:lautturi