Skip to content

Commit 4711d9e

Browse files
committed
Reformat Utils
1 parent 6bacc67 commit 4711d9e

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

‎src/com/codenext/util/Utils.java‎

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ public static void printArray(int[] arr) {
1414
System.out.println();
1515
}
1616

17-
public static int[] randomArray(int size){
18-
//Initialize array with random number
19-
int[] arr = new int[size];
20-
Random random = new Random();
21-
for (int i = 0; i < size; i++) {
22-
arr[i] = random.nextInt(1000);
23-
}
24-
println("Random array:");
25-
printArray(arr);
26-
return arr;
27-
}
2817
public static void printArray(int[][] arr) {
2918
for (int i = 0; i < arr.length; i++) {
3019
printArray(arr[i]);
@@ -39,13 +28,27 @@ public static int sum(int[] arr) {
3928
return result;
4029
}
4130

42-
static public void print(String s){
31+
static public void print(String s) {
4332
System.out.print(s);
4433
}
45-
static public void println(String s){
34+
35+
static public void println(String s) {
4636
System.out.println(s);
4737
}
48-
static public void println(){
38+
39+
static public void println() {
4940
System.out.println();
5041
}
42+
43+
public static int[] randomArray(int size) {
44+
//Initialize array with random number
45+
int[] arr = new int[size];
46+
Random random = new Random();
47+
for (int i = 0; i < size; i++) {
48+
arr[i] = random.nextInt(1000);
49+
}
50+
println("Random array:");
51+
printArray(arr);
52+
return arr;
53+
}
5154
}

0 commit comments

Comments
 (0)