修改了注册接口

This commit is contained in:
2025-05-15 20:31:28 +08:00
parent b946338c6d
commit 72d4be7ed7
2 changed files with 43 additions and 8 deletions

View 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;
}
}