forked from Assasincoderzz/Java-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp3.java
19 lines (19 loc) · 830 Bytes
/
p3.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class StringComparison {
public static void main(String a[]){
String str = "JavaTpoint is a great website to acquire knowledge";
StringBuffer obj =
new StringBuffer("JavaTpoint is a great website to acquire knowledge");
if(str.contentEquals(obj)){
System.out.println("The content of the string is equal");
} else {
System.out.println("The content of the string is not equal");
}
StringBuffer obj1 =
new StringBuffer("It is another string");
if(str.contentEquals(obj1)){
System.out.println("The content of the string is equal");
} else {
System.out.println("The content of the string is not equal");
}
}
}