// Program 44: Delete Repeated Characters from a Sentence import java.util.*; class RemoveRepeatedCharacters { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter a sentence: "); String s = sc.nextLine(); String result = ""; for (int i = 0; i < s.length(); i++) { char ch = Character.toUpperCase(s.charAt(i)); boolean found = false; for (int j = 0; j < result.length(); j++) { if (result.charAt(j) == ch) { found = true; } } if (!found) { result += ch; } } System.out.println("Original: " + s); System.out.println("New sentence: " + result); } }