0%

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public static void main(String[] args) {
/*==================复制======================*/
//克隆
int[] a = {1,2,3,4};
// int[] copyA = a.clone();
//
// int[] copyA = Arrays.copyOf(a, 4);
//
// int[] copyA = Arrays.copyOfRange(a, 1, 4);
//
// //a数组的0开始复制到copyA的1开始,复制长度3
// int[] copyA = new int[4];
// System.arraycopy(a, 0, copyA, 1, 3);
// System.out.println(Arrays.toString(copyA));

/*==================填充======================*/
Arrays.fill(a, 100);
System.out.println(Arrays.toString(a));

Arrays.fill(a, 1,3,99);
System.out.println(Arrays.toString(a));
}
阅读全文 »

Java注解
注解的本质
@Target(ElementType.METHOD)@Retention(RetentionPolicy.SOURCE)
public @interface Override {
}
这是注解 @Override 的定义,其实它本质上就是:
public interface Override extends Annotation{
}
有关这一点,你可以去反编译任意一个注解类。

阅读全文 »

前言

阅读全文 »
Title - Artist
0:00