Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
gattonero1052 committed Nov 21, 2018
1 parent e7130b1 commit fab337b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ out/
.project
.classpath
.idea/
.vscode/
*.iml
10 changes: 7 additions & 3 deletions java-project/src/main/java/com/mskf/utils/Printer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ public static String print(List objs, boolean getResult,int level){
}

//方便切换是否打印输出
public static void print(Object obj) throws Exception{
Method method = Printer.class.getMethod("print",new Class[]{obj.getClass(),boolean.class});
method.invoke(null,obj,true);
public static void print(Object obj){
try{
Method method = Printer.class.getMethod("print",new Class[]{obj.getClass(),boolean.class});
method.invoke(null,obj,true);
}catch (Exception e){
System.out.println("Type not match");
}
}

public static void main(String[] args){
Expand Down
4 changes: 3 additions & 1 deletion markdowns/list.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# List
Using Sample List: 3,1,5,4,1,-2
if you want to change inputs, for example, you can use
```ArrayList<Integer> list = Arrays.stream(new int[]{1,2,3,4,5}).boxed().collect(Collectors.toCollection(ArrayList::new))```
```java
ArrayList<Integer> list = Arrays.stream(new int[]{1,2,3,4,5}).boxed().collect(Collectors.toCollection(ArrayList::new))
```
to get a new list of 1,2,3,4,5


Expand Down

0 comments on commit fab337b

Please sign in to comment.