public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.nextLine();
String b = sc.nextLine();
if(a.equals(b) == true) {
System.out.println("The strings are the same");
} else{
System.out.println("The strings are different");
}
}
}
Solution
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
David Muñoz Technical Lead at Mechdyne
9 August 2023, 01:52
thank you!! i was just missing the == true
in the if(a.equals(b) == true)
thanks!
0
Andrew Bracero
28 February 2023, 04:47
I believe the error is in the line
What I believe you meant to show is if true which would be
Not sure if that fixes the issue. Hope it does! Cheers +1