wshcdr 最近回复了
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) {
// 创建一个 Map
Map<String, String> map = new HashMap<>();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
// 使用 Lambda 表达式遍历
map.forEach((key, value) -> {
System.out.println("Key: " + key);
});
}
}
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) {
// 创建一个 Map
Map<String, String> map = new HashMap<>();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
// 遍历 entrySet
for (Map.Entry<String, String> entry : map.entrySet()) {
System.out.println("Key: " + entry.getKey() + ", Value: " + entry.getValue());
}
}
}
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class Main {
public static void main(String[] args) {
// 创建一个 Map
Map<String, String> map = new HashMap<>();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
// 获取所有的 key
Set<String> keys = map.keySet();
// 遍历 key
for (String key : keys) {
System.out.println("Key: " + key);
}
}
}
#include <iostream>
int main() {
std::cout << "Press any key to continue..." << std::endl;
std::cin.get(); // 等待用户按下一个键
std::cout << "Continuing..." << std::endl;
return 0;
}
BS 天生就是 Request 和 Response ,你不 Response ? 除非你造 HTTP 的反