I've updated my example for you to include the InputStreamReader instead of the Scanner class.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class PigLatin {
/**
* JavaProgrammingForums.com
*/
public static String translate(String sentance) {
// Translate code here
return sentance;
}
public static void main(String[] args) {
PigLatin pig = new PigLatin();
String sentence, result;
try {
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
do {
System.out.println("Please enter a sentence: ");
sentence = br.readLine();
result = pig.translate(sentence);
System.out.println("That sentence in Pig Latin is: ");
System.out.println(result);
} while (!result.equals("y"));
} catch (IOException e) {
e.printStackTrace();
}
}
}