Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7078743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:35:06+00:00 2026-05-28T06:35:06+00:00

I am trying to find out weekdays using DateFormatSymbols and here is a short

  • 0

I am trying to find out weekdays using DateFormatSymbols and here is a short programe

String[] shortWeekdays = new DateFormatSymbols().getShortWeekdays();
        System.out.println(shortWeekdays.length);

        for (int i = 0; i < shortWeekdays.length; i++) {
            String shortWeekday = shortWeekdays[i];
            System.out.println("shortWeekday = " + shortWeekday);
        }

and it is giving me folloiwng output

  • shortWeekday =
  • shortWeekday = Sun
  • shortWeekday = Mon
  • shortWeekday = Tue
  • shortWeekday = Wed
  • shortWeekday = Thu
  • shortWeekday = Fri
  • shortWeekday = Sat

i am not sure why its giving total length as 8 while it should give it as 7

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:35:07+00:00Added an answer on May 28, 2026 at 6:35 am

    The range of values for Calendar.{SUNDAY, MONDAY, ... SUNDAY } is 1-7. The docs for getShortWeekDays() state:

    Returns: the short weekday strings. Use Calendar.SUNDAY, Calendar.MONDAY, etc. to index the result array.

    So I’d expect an array which can be indexed with values 1-7… which means it has to have 8 elements (as all arrays in Java are 0-based).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find out whether I should be using business critical logic in
I'm trying to find out about the Extras menu on windows phone. Extras.xml. Here
I'm trying to find out if there is a way of using clickTag and
I have been trying to find out how to bind data to a System.Windows.Forms.DomainUpDown()
Trying to find out how to build a private cloud using WSO2 Stratos. I
I'm trying to find out the difference between using one colon : and two
Im trying to find out a good JavaScript library that can create a nice
I'm trying to find out how much memory my own .Net server process is
I'm trying to find out if there is any way to elevate a specific
I'm trying to find out the 'correct' windows API for finding out the localized

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.