I have this programming, and for the first time in our class we are writing code in Java. I asked my instructor and could not get any help.
The program should count the word pairs from the file and display them as follows:
abc: hec, 1
This means that there was only one time in the text file, followed by "abc" followed by "hec". I need to use Framework Collections in java. Here is what I still have.
import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.FileNotFoundException; import java.util.Scanner; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.ArrayList;
The problem I am facing right now is that it runs too often in a loop:
if (!word.equals("---")) {
Does anyone have any ideas or advice on this?
source share