-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJack.java
43 lines (34 loc) · 1.28 KB
/
Jack.java
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
34
35
36
37
38
39
40
41
42
43
public class Jack {
public static void main(String[] args) {
/* String s = "sachin";
System.out.println(s.concat(" tendulkar"));
s += " IND" ;
System.out.println(s);
s = s+" MI";
System.out.println(s);
System.out.println(s.substring(7,10));
System.out.println(s.substring(7));
System.out.println(s.length());
System.out.println(s.replace('n','Z'));
System.out.println(s.toLowerCase());
System.out.println(s.toUpperCase());
System.out.println(s.trim());
System.out.println(s.indexOf('k'));
System.out.println(s.indexOf('I'));
System.out.println(s.lastIndexOf('I'));
String s1=new String("sachin");
String s2=s1.toString();
String s3=s1.toUpperCase();
String s4=s1.toLowerCase();
String s5=s1.toUpperCase();
String s6=s1.toLowerCase();
System.out.print(s1==s6);//true
System.out.print(s1==s2);//true
System.out.print(s1==s3);//false
System.out.print(s1==s4);//true
System.out.print(s1==s5);//false
System.out.print(s3==s6);//false */
String s1 = "hello";
System.out.println(s1.concat(" ").concat("world"));
}
}