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

  • Home
  • SEARCH
  • 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 8808385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:36:34+00:00 2026-06-14T02:36:34+00:00

I have searched and can’t seem to find an answer on this. I understand

  • 0

I have searched and can’t seem to find an answer on this. I understand what an Enumeration type is, but I can’t for the life of me determine how to create and return one in a function. Basically, I have a function:

public Enumeration getKeys(){
    //Returns an Enumeration of valid keys in the hash table
}

that needs to return an Enumeration.

My hashtable contains a key object and a value object, and I have already implemented methods like containsKey(Object key) and retrieve(Object key) to help me determine if a key is valid in the table and what the contents of the table at the key value are. Any help on understanding where to start with building an Enumeration type and returning it would be greatly appreciated.

  • 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-06-14T02:36:35+00:00Added an answer on June 14, 2026 at 2:36 am

    It is “relatively” easy, change your code like this:

    public Enumeration getKeys(){
           return new Enumeration() {
    
            @Override
            public boolean hasMoreElements() {
                // TODO Test if this enumeration contains more elements.
                return false;
            }
    
            @Override
            public Object nextElement() {
                // TODO Return the next element of this enumeration if this enumeration object has at least one more element to provide.
                return null;
            }
        };
        }
    

    Now it is up to you to implement the two methods with respect of you business rules.

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

Sidebar

Related Questions

I have searched quite thoroughly on this but can't seem to find an answer.
I have searched about this but can't seem to find exactly how to do
I have searched everywhere but just can't seem to find the answer. Can you
I have searched this site and also googled but can't seem to find the
I have searched around but can't find the answer to this relatively simple question;
I have searched around for an answer to this but can't find one. When
I have searched heavily for an answer but can't find how to do this;
I have searched but can't find why this simple code will fail in Drools
OK so I have searched and searched, but can't seem to find a reference
I have searched stackoverflow to find an answer but i can not find one.

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.