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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...