I'm trying to create a method which will search through an ArrayList containing several words searching for a specific String. Where if the String is not equal to any words in the ArrayList it will add the word to the list, and if the word already exists in the list, it will count how many times the word occurs and then add one more, which will represent the last String input. 
This is what I've got so far in my code:

```
public void leggTilOrd(String ord) {
    if (Ord.contains(ord)) {
        teller++;
    }

    if (!Ord.contains(ord)) {
        Ord.add(ord);
    }

    System.out.println(teller);
}

```

Obviously this will only add one more number in the counter (teller), so what I'm trying to achieve it to add 1 on top of all the occurrences of that specific String in the list and this is where I'm stuck. 

Edit: I should also mention that Ord is an ArrayList I've created earlier in the code.
Here's the full code:

```
import java.util.Scanner;
import java.io.File;
import java.util.ArrayList;

public class Ordliste {

private ArrayList<String> Ord = new ArrayList<String>();
private int teller = 0;

public void lesBok (String filnavn) throws Exception{
Scanner fil = new Scanner(new File(filnavn));
while(fil.hasNextLine()){
  Ord.add(fil.next());
} fil.close();
}

 public void leggTilOrd(String ord){
 if(Ord.contains(ord)){
  teller++;
  } if (!Ord.contains(ord)){
  Ord.add(ord);
  } System.out.println(teller);
  }
  }

```