forked from zfman/AlgorithmCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayUtils.java
More file actions
32 lines (29 loc) · 750 Bytes
/
ArrayUtils.java
File metadata and controls
32 lines (29 loc) · 750 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
package utils;
/**
* @author 刘壮飞
* https://github.com/zfman.
* https://blog.csdn.net/lzhuangfei.
*/
public class ArrayUtils {
public static void printArray(int[] a){
if(a==null) return;
for(int i=0;i<a.length;i++){
System.out.print(a[i]+" ");
}
System.out.println();
}
public static void printArray(boolean[] a){
if(a==null) return;
for(int i=0;i<a.length;i++){
System.out.print(a[i]?"1 ":"0 ");
}
System.out.println();
}
public static void printArray(int[] a,int start){
if(a==null) return;
for(int i=start;i<a.length;i++){
System.out.print(a[i]+" ");
}
System.out.println();
}
}