-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestDemo.java
More file actions
35 lines (30 loc) · 868 Bytes
/
Copy pathTestDemo.java
File metadata and controls
35 lines (30 loc) · 868 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
34
35
package studyjava;
public class TestDemo {
private int x ;
private String name ;
public TestDemo(){
}
public String toString(){
return "age:"+this.name;
}
public TestDemo(int x, String name ){
this.name= name;
this .x = x;
}
public static void main(String[] args) {
TestDemo testDemo =new TestDemo(18,"LJR");
String str = "hello";
System.out.println(testDemo.toString()+str);
String s1= "123";
String s2 = "123";
System.out.println(s1==s2);
String s3 = s1 ;
System.out.println(s1);
System.out.println(s3==s1);
System.out.println(s3 ==s2 );
int x =Integer.parseInt("123");
System.out.println(x);
String string = " alksjdfbkb one bot";
System.out.println(string.contains("bot"));
}
}