Jump to content
  • 0

Question

Posted (edited)

http://imgur.com/a/KJwdY

protected int getVoteWinner()
	{
		int old = 0;
		HashMap<Integer, Integer> temp = new HashMap<>();
		
		for (int vote : votes.values())
		{
			if (!temp.containsKey(vote))
				temp.put(vote, 1);
			else
			{
				old = temp.get(vote);
				old++;
				temp.getEntry(vote).setValue(old);
			}
		}
		
		int max = temp.head().getNext().getValue();
		int result = temp.head().getNext().getKey();
		
		for (Map.Entry<Integer, Integer> entry : temp.entrySet())
		{
			if (entry.getValue() > max)
			{
				max = entry.getValue();
				result = entry.getKey();
			}
		}
		
		votes.clear();
		temp = null;
		return result;
	}

How do I solve this problem? Use aCis 350, replaces FastMap with HashMap and is giving this error.

Edited by L2shaken

Recommended Posts

  • 0
Posted (edited)

JpEK-fxuapvw1908473.gif

Thank you Sir SweeTs

 

As you see dear topic owner, if you're going to make a server you must put some effort and learn the basics. Asking for help when your knowledge is 0 along with free packs in order to make money saying that "the reason i make it is not money is just my dream" it's fail. 

Edited by AccessDenied
  • 0
Posted

Since when did this forum turn into a circlejerk? This is a help section and people can ask whatever the hell they want, they are not here to be judged.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock