Java DateFormatSymbols getShortWeekdays() Example

DateFormatSymbols class getShortWeekdays() method example. This example shows you how to use getShortWeekdays() method.


Syntax is : public String[] getShortWeekdays()public String[] getWeekdays()
Method returns short weekday strings. For example: "Sun", "Mon", etc.

Here is the code.
/**
 * @(#) GetShortWeekdaysDateFormatSymbols.java
 * A class representing use of method getShortWeekdays() of DateFormatSymbols
class in java.text Package.
 * @Version  14-May-2008
 @author   Rose India Team
 */
import java.text.*;

class GetShortWeekdaysDateFormatSymbols {

    public static void main(String[] args) {

        // Create new DateFormatSymbols object.
        DateFormatSymbols dFormatSymbols = DateFormatSymbols.getInstance();

        // getShortWeekdays() method call.
        String[] weekDays = dFormatSymbols.getShortWeekdays();
        System.out.print("Week days in short form : ");
        for (int i = 0; i < weekDays.length; i++) {
            System.out.println(weekDays[i]);
        }
    }
}

Output of the program.
 Week days in short form :
Sun
Mon
Tue
Wed
Thu
Fri
Sat

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US