-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.java
More file actions
65 lines (55 loc) · 2 KB
/
test.java
File metadata and controls
65 lines (55 loc) · 2 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* @author : CodeWater
* @create :2022-03-17-0:10
* @Function Description :
*/
public class test {
public static void main(String[] args) {
// ArrayList<Integer> a = new ArrayList<>();
// for (int i = 0; i < 5; i++) {
// a.add(i);
// }
//// a.remove((int)random(0 , ))
//// for (int i = 0; i < 5; i++) {
//// a.get(i);
//// }
// System.out.println( a.get(0));
// System.out.println( a.get(1));
// System.out.println(a.size());
// System.out.println(a.toString());
// a.remove(3);
// System.out.println(a.size());
// System.out.println(a.toString());
// zi z = new zi();
// zi.eat();
// int a = (int)3.9f;//下取整
// System.out.println( a);
// char和String转换
// char a = 'c';
// Object aa = (Object)a;//必须要转成object这样才能用反射判断类型
// String b = String.valueOf( a );
// System.out.println( aa.getClass().getSimpleName());
// System.out.println( b instanceof String);
// String s = String.valueOf(new char[]{'c' , 'f' , 'g'});
// System.out.println(s);
// int[12] a = {0};
// System.out.println(a.length);
// int a = 42 ;
//// float b = 42.0f;
// double b = 42.00000;
// if(a == b ) System.out.println(true);
// int s = (-10) % 3 ;//-1
// int a = 10 % 3;//1
// System.out.println( "负数模:" + s + "正数模:" + a );
// zi a = new zi("张三" , "123");
// zi b = a;
// b.setName("lise");
// System.out.println(a.getName()+ a.getPhone());//都是张三
// System.out.println(b.getName() + b.getPhone());
// 测试局部变量数组有无初始值
// String[] a = new String[10];//有
// int[] b;//不new的话还是没有!!!!会直接报错
// for (String i : a) System.out.print(i + " ");
// for (int i : b) System.out.println(i + " ");
}
}