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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:55:23+00:00 2026-05-19T16:55:23+00:00

I have an Object[] which entails lots of Objects of the type HashMap. The

  • 0

I have an Object[] which entails lots of Objects of the type HashMap. The HashMap looks like this:

Object[]
{id=15, name=Hello}
{id=27, name=Hello}
{id=15, name=Hello}

I have tried to cast it to HashMap[], however no luck.

I would like to iterate and retrieve a list of names. Hope you can help me.

  • 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-19T16:55:23+00:00Added an answer on May 19, 2026 at 4:55 pm

    you can’t cast a array holding T1 to a array holding T2. An array in a actual object with a type of itself. This is the cause of your failure to cast.

    However i doubt that you really have a HashMap array in there. The dump you are providing doesn’t look like a hashmap dump.

    However to answer your original question you should do something like this:

        // assuming hashes is your array
        Object []hashes;
    
        for (Object object : hashes) {
            HashMap hash = (HashMap)object;
    
            for (Object o : hash.values()) {
                System.out.println(o);
            }
        }
    

    this will print all the values on all the hashes from your array.

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

Sidebar

Related Questions

I have an object which looks something like this class MyObject { string Name;
I have an object which looks for example like this Name Number ---- ------
I have an object in my javascript which looks like this: {data:[{t:{ level:35, longtitude:121.050321666667,
I have an object which has inner objects and properties defined like this: var
I have an object which looks likes this: [{amount:500.0,when:2012-03-13}, {amount:500.0,when:2012-03-24}, {amount:100.0,when:2012-04-14}, {amount:100.0,when:2012-04-16}] I would
I have a object which i looked from firebug looks like following var object
I have this object which is an instance of a superclass. I want to
So I have an object which contains a set of objects in a private
I have an object which has properties ID, brandID, brandName, NumPages, and Type. i
i have an object which holds a user name and job count, which then

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.