修改了注册接口
This commit is contained in:
32
src/test/java/com/greenorange/promotion/list/ListTest.java
Normal file
32
src/test/java/com/greenorange/promotion/list/ListTest.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.greenorange.promotion.list;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ListTest {
|
||||
public static void main(String[] args) {
|
||||
List<Node> list = new ArrayList<>();
|
||||
list.add(new Node(1));
|
||||
list.add(new Node(2));
|
||||
list.add(new Node(3));
|
||||
for (Node node : list) {
|
||||
System.out.println(node.val);
|
||||
}
|
||||
for (Node node : list) {
|
||||
node.setVal(1);
|
||||
}
|
||||
for (Node node : list) {
|
||||
System.out.println(node.val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Node {
|
||||
int val;
|
||||
public Node(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
public void setVal(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user