Просмотр исходного кода

matrix: make classes and methods package private in reference solution. Resolved the issue (#1083)

* made the class as the package private and the removed the public access modifier

* made the class as the package private and the removed the public access modifier

* removing the extra spaces

* removed the access modifier of the class Hamming and also the methods involving it

* added the private access modifier for the methods in Hamming class
PratikPalashikar 8 лет назад
Родитель
Сommit
3093dd8d24
1 измененных файлов: 6 добавлений и 6 удалений
  1. 6
    6
      exercises/matrix/.meta/src/reference/java/Matrix.java

+ 6
- 6
exercises/matrix/.meta/src/reference/java/Matrix.java Просмотреть файл

@@ -1,11 +1,11 @@
1 1
 import java.util.regex.Pattern;
2 2
 
3
-public class Matrix {
3
+class Matrix {
4 4
     private int[][] matrix;
5 5
     private static Pattern spacePattern = Pattern.compile(" ");
6 6
     private static Pattern newlinePattern = Pattern.compile("\\n");
7 7
 
8
-    public Matrix(String matrixAsString) {
8
+     Matrix(String matrixAsString) {
9 9
         String[] rows = newlinePattern.split(matrixAsString);
10 10
         matrix = new int[rows.length][];
11 11
         for (int i = 0; i < rows.length; i++) {
@@ -17,11 +17,11 @@ public class Matrix {
17 17
         }
18 18
     }
19 19
 
20
-    public int[] getRow(int rowNumber) {
20
+    int[] getRow(int rowNumber) {
21 21
         return matrix[rowNumber];
22 22
     }
23 23
 
24
-    public int[] getColumn(int columnNumber) {
24
+    int[] getColumn(int columnNumber) {
25 25
         int[] column = new int[matrix.length];
26 26
         for(int i = 0; i < matrix.length; i++) {
27 27
             column[i] = matrix[i][columnNumber];
@@ -29,11 +29,11 @@ public class Matrix {
29 29
         return column;
30 30
     }
31 31
 
32
-    public int getRowsCount() {
32
+    int getRowsCount() {
33 33
         return matrix.length;
34 34
     }
35 35
 
36
-    public int getColumnsCount() {
36
+    int getColumnsCount() {
37 37
         return matrix[0].length;
38 38
     }
39 39
 }