Question: Here's my code :

```
public class PigLatinizer {
    public static int pigLatinOut(String originalWord) {
        int index;
        for(int i=0;i<originalWord.length();i++){
            if(originalWord.charAt(i)== 'A'||originalWord.charAt(i)=='E' || originalWord.charAt(i) =='I'||originalWord.charAt(i)=='O' ||originalWord.charAt(i)=='U'){
                index = i;
            }
            else{index=0;}

        }
        return index;
    }
    public static void main(String[] args){
        System.out.println(pigLatinOut("TEST"));
    }
}

```

I dont know what exactly do here, but here's the output :

```
C:\Users\amarn\IdeaProjects\General Programs\src\PigLatinizer.java:13:16
java: variable index might not have been initialize

```

Answer: 
You should break after finding any word in the if clause! Because your loop will always loop to the end and the last work does not contain any char you need then it will always return 0. You just need to add `break;`, that is all.

```
public class PigLatinizer {
public static int pigLatinOut(String originalWord) {
    int index=0;//edited, same result
    for(int i=0;i<originalWord.length();i++){
        if(originalWord.charAt(i)== 'A'||originalWord.charAt(i)=='E' || originalWord.charAt(i) =='I'||originalWord.charAt(i)=='O' ||originalWord.charAt(i)=='U'){
            index = i;
            break;
        }
        else{index=0;}

    }
    return index;
}
public static void main(String[] args){
    System.out.println(pigLatinOut("TEST"));
}

```
The issue is that you have not initialized your variable `index`. Set it to some value, for example, 0, when you are declaring it (this is called initializing).

If you simply declare it without a value and try to retrieve it, the compiler will not know what to retrieve, because a default value hasn't been set. Your loop conditions aren't going to happen for sure, so when you are doing `return index;` the compiler is not sure what to do.

To answer your question, to return the index of the first character that is a vowel:

```
public static int pigLatinOut(String originalWord) {
        int index = 0;
        for (char c : originalWord.toLowerCase().toCharArray()) {
            if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'y') {
                return index;
            }
            index++;
        }
        return -1; // if there are no vowels

}

```

Just run a loop of the chars in the String and retrieve the index.