Why is this code not working
I was completing the Pig Latin challenge but was not able to complete it. I am not able to understand what is wrong with the code. Someone please help me with the code import java.util.*; import java.lang.*; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); String sentence = input.nextLine(); Scanner checker = new Scanner(sentence); String s = ""; while(checker.hasNext()) { s=checker.next(); s=s+s.substring(0,1); s=s.concat("ay"); s=s.replace(s.substring(0,1), ""); System.out.print(s + " "); } } }