Input
Output
public class CompareStrings { public static void main(String[] args) { // Manually assigned strings String str1 = "onlintpoint"; String str2 = "onlintpoint"; // Simulate input prompts with the assigned values System.out.println("Enter the first string: " + str1); System.out.println("Enter the second string: " + str2); // Compare strings using equals() method if (str1.equals(str2)) { System.out.println("The strings are equal."); } else { System.out.println("The strings are NOT equal."); } } }