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 6115115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:03:14+00:00 2026-05-23T15:03:14+00:00

I had a test for object Calendar: for (int i = 0; i <

  • 0

I had a test for object Calendar:

for (int i = 0; i < 11; i++)
            System.out.println(calendar.get(i));


output:
1
2011
6
28
2
6
187
4
1
1
10

My question is how can that happen? There are also the same tricky problems for api calendar.get()

  • 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-23T15:03:14+00:00Added an answer on May 23, 2026 at 3:03 pm

    I don’t see what the problem is. The documentation states that you get the specific values for whatever field ID you provide.

    You would normally use the field constants to get specific values (like DAY_OF_MONTH or MONTH but any integer will do provided it’s within the range 0..FIELD_COUNT.

    The field IDs are documented here (though this may change in future) so your specific values are:

    ID  Value  Description
    --  -----  -----------
     0      1  Era (BC/AD for Gregorian).
     1   2011  Year.
     2      6  Month (zero-based).
     3     28  Week-of-year.
     4      2  Week-of-month.
     5      6  Date/day-of-month.
     6    187  Day-of-year.
     7      4  Day-of-week.
     8      1  Day-of-week-in-month.
     9      1  AM/PM selector.
    10     10  Hour.
    

    That’s July 6, 2011 AD, somewhere between 10:00:00 PM and 10:59:59 PM inclusive. The minutes and seconds values are field IDs 12 and 13 and your code doesn’t print them out, hence the uncertainty on the time.

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

Sidebar

Related Questions

We had a test project that started out as MbUnit v3 / Gallio but
I've had a test, and there was a question I lost some points on,
To test if my object had a memory leak, I instanced it 10000 times
I thought i had it working but I still can't figure out how to
I just had a test on java and we had to give the definition
I had a simple table: class test(Base): __tablename__ = 'test' id = Column(Integer, primary_key=True)
I've had been hearing about test driven development for a couple years now, and
I had set up a bunch of NUnit unit tests using the Test connection
Has anybody had any success getting Team Build to show xUnit.net test results and
Has anyone had any luck running two instances of the iPhone simulator to test

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.