map引用传递问题???????????

Map> map=new HashMap<>();
List l=new ArrayList<>();
map.put("yu",l);
List list=map.get("yu");
System.out.println(map);

``````            为什么list存的值回到map里？
``````

2个回答

Treasure Map 是如何实现的
Problem Description "Take 147 steps due north, turn 63 degrees clockwise, take 82 steps, ...". Most people don't realize how important accuracy is when following the directions on a pirate's treasure map. If you're even a tiny bit off at the start, you'll end up far away from the correct location at the end. Pirates therefore use very exact definitions. One step, for instance, has been defined by the 1670 Pirate Convention to be exactly two times the size of the wooden leg of Long John Silver, or 1.183 m in metricunits. Captain Borbassa was thus not at all worried when he set sail to the treasure island, having a rope with knots in it, exactly one step apart, for accurately measuring distances. Of course he also brought his good old geotriangle, once given to him by his father when he was six years old. However, on closer inspection of the map, he got an unpleasant surprise. The map was made by the famous captain Jack Magpie, who was notorious for including little gems into his directions.In this case, there were distances listed such as sqrt(33) steps. How do you measure that accurately? Fortunately, his first mate Pythagor came to the rescue. After puzzling for a few hours, he came up with the following solution: let pirate A go 4 steps into the perpendicular direction, and hold one end of the measuring rope there. Then pirate B goes into the desired direction while letting the rope slide through his fingers, until he is exactly 7 steps away from pirate A. Pythagor worked out a formula that states that pirate B has then traveled exactly sqrt(33) steps. Captain Borbassa was impressed, but he revealed that there were more such distances on the map. Paranoid as he is, he refuses to let Pythagor see the map, or even tell him what other distances there are on it. They are all square roots of integers, that's all he gets to know. Only on the island itself will the captain reveal the numbers, and then he expects Pyhtagor to quickly work out the smallest two integer numbers of steps that can combine to create the desired distance, using the method described above. Pythagor knows this is not easy, so he has asked your help. Can you help him by writing a program that can determine these two integers quickly? By the way, he did ask the captain how large the numbers inside the square root could get, and the captain replied "one billion". He was probably exaggerating, but you'd better make sure the program works. If you can successfully help the pirates, you'll get a share of the treasure. It might be gold, it might be silver, or it might even be... a treasure map! Input The first line of the input contains a single number: the number of test cases to follow. Each test case has the following format: 1.One line with one integer N, satisfying 1 <= N <= 10^9. Output For every test case in the input, the output should contain two nonnegative integers, separated by a space, on a single line: the distance pirate A needs to head in the perpendicular direction, and the final distance between pirate A and B, such that pirate B has traveled sqrt(N) steps. If there are multiple solutions, give the one with the smallest numbers. If there are no solutions, the output should be "IMPOSSIBLE" (without the quotation marks) on a single line. Sample Input 4 33 16 50 101 Sample Output 4 7 0 4 IMPOSSIBLE 50 51
cpp中 以struct为map的key引发的问题

C++ 中map类型为什么不能直接insert一个initializer_list？
> 想做一个函数，能直接接收成绩，然后生成一个map类型 > 例如：函数中接收{ {"englist",100},{"math",100} }参数，然后在map中直接插入 但是在编写函数的时候遇到了一些比较困惑的问题 ![图片说明](https://img-ask.csdn.net/upload/202001/01/1577856654_225553.jpg) 有如下几个疑惑 1. 为什么map类型能直接插入一个和initializer_list一样结构的参数，却不能直接插入一个initializer_list类型？ 2. 为什么map类型的key不能是引用 3. 请问map类型如何正确高效地接收initializer_list参数呢，像我下面写的那样把pair一个一个地插入到map中吗？ 小白提前谢谢各位！求指教
java spring map 传值问题

CXF webservice传递复杂对象Map

JAVA MAP的数据处理。。。。
{map=[{a=1, b=2}, {a=3, b=4},{a=5, b=6]} 新手小白求助，对于上面这个MAP我怎么遍历成单个的MAP 比如{a=1, b=2}，{a=3, b=4} 求详细代码，谢谢！！
Esper map EventType热加载问题。 在删除或者修改字段时如何解决？？
postman可以传递map吗？
C++map类型 这里用[]操作符为什么会报错？
java8，如何根据条件合并两个List<HashMap>

java8 新特性 stream，set 转 map<String, Set<>> 问题
``` class User{ String type; String userId; ... } // 现有 Set<User> users; 需要将相同 type 转成 Map<Stirng, Set<User>> // 需要怎样用 stream // 使用的 for 循环 Map<String, Set<User>> map = new HashMap<>(); for (User u : users) { if (!map.containsKey(u.getType())) map.put(u.getType(), new HashSet<User>()); map.get(u.getType()).add(u); } // 使用 stream 怎样实现相同同能 ```
map中如何使用3个键值定位一个元素？

Java基础关于Map集合问题
Map<String,String> map = new LinkedHashMap<String,String>(); 这样写与 Map map = new LinkedHashMap();有什么区别，，，在Eclipse都能编译通过，，而且在进行迭代时，显示也没有问题？ 想知道这样的区别到底是什么，，，因为看到所有的视频都是按照第一种写法
Springboot Map传到前台,Long值越界问题
@GetMapping("/edit/{csmId}") public String edit(@PathVariable("csmId") Long csmId, ModelMap map){ IBaseDto dtoMap=new BaseDtoImpl(); dtoMap.put("csmId", csmId); List ret=ColumnSaveMainService.findList(dtoMap); if(ret.size()>0){ map.put("formData", ret.get(0)); } return prefix + "/addEdit"; } var add = 'null'; var formData = {"csmId":615181341067051008,"csmName":"costItemList.js-grid","csmTitle":null,"csmRemark":null,"createBy":5,"createAt":"2019-08-25T13:51:01.000+08:00","updateBy":5,"updateAt":"2019-08-25T13:51:58.000+08:00","createByName":null,"updateByName":null}||{ csmId : ext_findNextval() }; csmId是一个Long类型,会越界,大家看一下有什么办法解决
JDK8中Map的问题，求大神解答

STL容器map 下标访问的问题
STL容器map 下标访问的问题 定义了如下的一个map 容器 Key 是int, values 是一个结构体 typedef struct _prostru { int jmqnum; int bncnun; _prostru() { jmqnum=-1; bncnun=-1; } }PROSTRU; map<int,PROSTRU> m_pro; m_pro[1].jmqnum=5; m_pro[2].bncnum=2; 在进程中 可以用下标访问和修改 结构体中的值 线程传入后 是个指针的 这样子写应该没错吧 map<int,PROSTRU> *pInfo=(map<int,PROSTRU> *)Pparam; 那么怎么用 pInfo 去修改 比如 下标Key为 1的值？ 要用迭代器么？find 后再改？ 能不能直接用数组下标一样的方法？ pInfo[1]->jmqnum=3;这样子的

Map of Ninja House 编程的问题
Description An old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become lost. Each room has at least two doors. The Ninja House can be modeled by a graph, as shown in Figure 1. A circle represents a room. Each line connecting two circles represents a door between two rooms. I decided to draw a map, since no map was available. Your mission is to help me draw a map from the record of my exploration. I started exploring by entering a single entrance that was open to the outside. The path I walked is schematically shown in Figure 2, by a line with arrows. The rules for moving between rooms are described below. After entering a room, I first open the rightmost door and move to the next room. However, if the next room has already been visited, I close the door without entering, and open the next rightmost door, and so on. When I have inspected all the doors of a room, I go back through the door I used to enter the room. I have a counter with me to memorize the distance from the first room. The counter is incremented when I enter a new room, and decremented when I go back from a room. In Figure 2, each number in parentheses is the value of the counter when I have entered the room, i.e., the distance from the first room. In contrast, the numbers not in parentheses represent the order of my visit. I take a record of my exploration. Every time I open a door, I record a single number, according to the following rules. 1. If the opposite side of the door is a new room, I record the number of doors in that room, which is a positive number. 2. If it is an already visited room, say R, I record "the distance of R from the first room" minus "the distance of the current room from the first room", which is a negative number. In the example shown in Figure 2, as the first room has three doors connecting other rooms, I initially record "3". Then when I move to the second, third, and fourth rooms, which all have three doors, I append "3 3 3" to the record. When I skip the entry from the fOurth room to the first room, the distance difference "-3" (minus three) will be appended, and so on. So, when I finish this exploration, its record is a sequence of numbers "3 3 3 3 -3 3 2 -5 3 2 -5 -3". There are several dozens of Ninja Houses in the city. Given a sequence of numbers for each of these houses, you should produce a graph for each house. Input The first line of the input is a single integer n, indicating the number of records of Ninja Houses I have visited. You can assume that n is less than 100. Each of the following n records consists of numbers recorded on one exploration and a zero as a terminator. Each record consists of one or more lines whose lengths are less than 1000 characters. Each number is delimited by a space or a newline. You can assume that the number of rooms for each Ninja House is less than 100, and the number of doors in each room is less than 100. Output For each Ninja House of m rooms, the output should consist of m lines. The i-th line of each such m lines should look as follows: i r(1) r(2)... r(ki), where r(1),... , r(ki), should be rooms adjoining room i, and ki should be the number of doors in room i. Numbers should be separated by exactly one space character. The rooms should be numbered from 1 in visited order. r(1), r(2),..., r(ki), should be in ascending order. Note that the room i may be connected to another room through more than one door. In this case, that room number should appear in r(1),...,r(ki), as many times as it is connected by different doors. Sample Input 2 3 3 3 3 -3 3 2 -5 3 2 -5 -3 0 3 5 4 -2 4 -3 -2 -2 -1 0 Sample Output 1 2 4 6 2 1 3 8 3 2 4 7 4 1 3 5 5 4 6 7 6 1 5 7 3 5 8 8 2 7 1 2 3 4 2 1 3 3 4 4 3 1 2 2 4 4 1 2 2 3

Java学习的正确打开方式

linux系列之常用运维命令整理笔录

Python十大装B语法
Python 是一种代表简单思想的语言，其语法相对简单，很容易上手。不过，如果就此小视 Python 语法的精妙和深邃，那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点，并附上详细的实例代码。如能在实战中融会贯通、灵活使用，必将使代码更为精炼、高效，同时也会极大提升代码B格，使之看上去更老练，读起来更优雅。 1. for - else 什么？不是 if 和 else 才

2019年11月中国大陆编程语言排行榜
2019年11月2日，我统计了某招聘网站，获得有效程序员招聘数据9万条。针对招聘信息，提取编程语言关键字，并统计如下： 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7

SQL-小白最佳入门sql查询一

【图解经典算法题】如何用一行代码解决约瑟夫环问题

“狗屁不通文章生成器”登顶GitHub热榜，分分钟写出万字形式主义大作

IT界知名的程序员曾说：对于那些月薪三万以下，自称IT工程师的码农们，其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居，但只是他们一厢情愿罢了。 此话一出，不知激起了多少(码农)程序员的愤怒，却又无可奈何，于是码农问程序员。 码农：你知道get和post请求到底有什么区别？ 程序员：你看这篇就知道了。 码农：你月薪三万了？ 程序员：嗯。 码农：你是怎么做到的? 程序员：
《程序人生》系列-这个程序员只用了20行代码就拿了冠军

11月8日，由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办，科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。 　　区块链技术被认为是继蒸汽机、电力、互联网之后，下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力，电力解决了人类基本的生活需求，互联网彻底改变了信息传递的方式，区块链作为构造信任的技术有重要的价值。 　　1

【技巧总结】位运算装逼指南

8年经验面试官详解 Java 面试秘诀
作者 | 胡书敏 责编 | 刘静 出品 | CSDN（ID：CSDNnews） 本人目前在一家知名外企担任架构师，而且最近八年来，在多家外企和互联网公司担任Java技术面试官，前后累计面试了有两三百位候选人。在本文里，就将结合本人的面试经验，针对Java初学者、Java初级开发和Java开发，给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实

1.两种思维方式在求职面试中，经常会考察这种问题：北京有多少量特斯拉汽车？ 某胡同口的煎饼摊一年能卖出多少个煎饼？ 深圳有多少个产品经理？ 一辆公交车里能装下多少个乒乓球？ 一