Biblioteca Java - Blame information for rev 26
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
26 | mihai | 1 | |
2 | public class ExempluSiruri { | ||
3 | public static void main(String[] args) { | ||
4 | String s1 = new String("Hello"); | ||
5 | System.out.println("Sirul s1 este:"+s1); | ||
6 | String s2 = "Hello world!"; | ||
7 | |||
8 | String s3 = s1 + s2; | ||
9 | |||
10 | if(s1.equals(s2)){ | ||
11 | System.out.println("Siruri egale"); | ||
12 | } | ||
13 | else{ | ||
14 | System.out.println("Siruri diferite"); | ||
15 | } | ||
16 | |||
17 | int k = s3.indexOf("Hel_lo"); | ||
18 | System.out.println("Positia = "+k); | ||
19 | |||
20 | String s4 = s3.toUpperCase(); | ||
21 | System.out.println(s4); | ||
22 | |||
23 | s1 = s4; | ||
24 | System.out.println(s1); | ||
25 | System.out.println(s4); | ||
26 | |||
27 | s1 = s1.toUpperCase(); | ||
28 | |||
29 | System.out.println(s1); | ||
30 | |||
31 | } | ||
32 | } |