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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:01:29+00:00 2026-05-20T23:01:29+00:00

I am having a Map of type HashMap. I am trying to iterate over

  • 0

I am having a Map of type HashMap.

I am trying to iterate over the map and for every entry, for which the boolean flag is set to true, I am trying to print the corresponding key value.

I am able to achieve this. However, instead of printing the String “key” values, it prints String objects. I tried casting it, using the .toString() function. Nothing solved it.

Any help would be greatly appreciated.

Thanks,S.

  • 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-20T23:01:30+00:00Added an answer on May 20, 2026 at 11:01 pm

    Your followup suggests that the values in your Map are not of type String and are not of a type that has overridden toString, which is why, when you call toString, you get a value like “com.f5.lunaui.emproto.reports.Device_Sri@334003”.

    In Device_Sri, you should override the toString method to return the String you want:

    @Override
    public String toString() {
        return "em_device90-36";
    }
    

    Of course, you’ll probably want to calculate the value “em_device90-36” from the fields of the Device_Sri class.

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

Sidebar

Related Questions

The problem i am having is like this there is variable <core:set var=type>*one of:
I'm having trouble trying to map my EF 4.1 Code First model to a
I'm trying to iterate over a collection of shared preferences, and generate an ArrayList
I've been trying to use auto return type templates and am having trouble. I
I am having a lil hard time with map and the valuetype allocation. consider
I am having problems using my custom class with a std::map. The class dynamically
I am having trouble with paths in ruby on rails My Routes: map.resources :companies
I'm having a problem with an iframed Google map. Basically, the position is incorrect,
I have a map with 4 layers, each layer having markers for various shops.
I want to show a dynamic google map on a .net web page. Having

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.