The setWeekdays(String newWeekds) Method of DateFormatSymbols class in Java is used to set the names of the weekdays of the calendar in string format into some different strings. For eg., “Sunday” can be changed to “FRIDAY”, “Monday” can be changed to “WEDNESDAY” or into some other random strings.
public void setWeekdays(String newWeekds)
Parameters: The method takes one parameter newWeekdswhich is an array of Stringtype and refers to the new strings that are to be replaced in the existing weekdays. Return Values: The method returns the modified names of the weekdays in a string format. Below programs illustrate the use of setWeekdays() method. Example 1:
Please Login to comment...