Changes

Jump to navigation Jump to search
438 bytes added ,  10:28, 20 April 2022
m
Line 3: Line 3:  
===With apt===
 
===With apt===
 
  <nowiki>sudo apt-add-repository ppa:webupd8team/java
 
  <nowiki>sudo apt-add-repository ppa:webupd8team/java
                            sudo apt-get update
+
                            sudo apt-get update
                            sudo apt-get install oracle-java8-installer</nowiki>
+
                            sudo apt-get install oracle-java8-installer</nowiki>
    
Also ensure your JAVA_HOME variable has been set to:
 
Also ensure your JAVA_HOME variable has been set to:
Line 489: Line 489:  
         }
 
         }
    +
 +
        Map<String, Integer> stringOccurances = new HashMap<>();
 +
        String[] words = str.split(" ");
 +
        for (String word:words){
 +
            Integer integer = stringOccurances .get(word);
 +
            if (integer == null) {
 +
                stringOccurances .put(word, 1);
 +
            } else {
 +
                stringOccurances .put(word, integer + 1);
 +
            }
 +
            System.out.println(stringOccurances );
 +
        }
 
          
 
          
 
     }
 
     }

Navigation menu