forked from anshulc55/JavaTraining
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringIntro.java
More file actions
33 lines (20 loc) · 761 Bytes
/
StringIntro.java
File metadata and controls
33 lines (20 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package String;
public class StringIntro {
public static void main(String[] args) {
String name = "Anshul Chauhan";
String name1 = "Anshul Chauhan";
String name2 = "anshul chauhan";
String country = new String("United State");
String country1 = new String("United State");
/*System.out.println(name.equals(name1));
System.out.println(name.equals(name2));
System.out.println(name.equalsIgnoreCase(name2));
System.out.println(country.equals(country1));*/
/*System.out.println(name == name1);
System.out.println(country == country1);*/
String finalString = name + name1 + name2;
System.out.println(finalString);
String secString = name.concat(name1).concat(name2);
System.out.println(secString);
}
}