At Westonci.ca, we provide reliable answers to your questions from a community of experts. Start exploring today! Our platform provides a seamless experience for finding reliable answers from a knowledgeable network of professionals. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

SOMEONE HELP ME!!!!!
public class WordCounts extends ConsoleProgram
{
public void run()
{
HashMap h = new HashMap ();
String input = readLine("Enter a string: ");
String[] words = input.split(" ");
for(int i=0; i wordCount){
// Sort all the keys (words) in the HashMap
Object[] keys = wordCount.keySet().toArray();
Arrays.sort(keys);

// Print out each word and it's associated count
for (Object word : keys) {
int val = wordCount.get(word);
System.out.println(word + ": " + val);
}
}
}
I can't fix this. these are the errors
WordCounts.java:30: error: cannot find symbol
private void printSortedHashMap(HashMap wordCount){
^
symbol: class HashMap
location: class WordCounts
WordCounts.java:5: error: cannot find symbol
HashMap h = new HashMap ();
^
symbol: class HashMap
location: class WordCounts
WordCounts.java:5: error: cannot find symbol
HashMap h = new HashMap ();
^
symbol: class HashMap
location: class WordCounts
WordCounts.java:33: error: cannot find symbol
Arrays.sort(keys);
^
symbol: variable Arrays
location: class WordCounts
4 errors


Sagot :

Answer:

I don't see the question

Explanation:

We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. Thank you for choosing Westonci.ca as your information source. We look forward to your next visit.