分析 java.util.LinkedHashMap

返回Map结构Unable to make field private static final long java.util.HashMap.serialVersionUID accessib问题 记录Unable to make field private static final long java.util.HashMap.serialVersionUID accessible问题 阅读详情

介绍

该实现与HashMap不同的是它维护一个双向链表,可以使HashMap有序。与HashMap一样,该类不安全。

结构

和HashMap的结构非常相似,只不过LinkedHashMap是一个双向链表

LinkedHashMap 分为两种节点 Entry 和 TreeNode 节点

Entry 节点结构:

class Entry<K,V> extends HashMap.Node<K,V> {  
    Entry<K,V> before, after;  
    Entry(int hash, K key, V value, Node<K,V> next) {  
        super(hash, key, value, next);  
    }  
}

before 和 after 是双向链表中的前继和后继节点

TreeNode 节点和 HashMap 中的一样

从这里能看出 LinkedHashMap 是一个双向链表

LinkedHashMap 有如下属性:

transient LinkedHashMap.Entry<K,V> head;
transient LinkedHashMap.Entry<K,V> tail;
final boolean accessOrder;

head 和 tail 很好理解就是双向链表的头和尾

HashMap 中没有 accessOrder 这个字段,这也是与 HashMap 最不同的地方,该类有两种取值分别代表不同的意思 :

  • true,按照访问顺序排序
  • false,按照插入顺序排序

HashMap预留的一些方法

HashMap 预留了一些方法提供给 LinkedHashMap 使用

// LinkedHashMap重写了以下四个方法来保证双向队列能够正常工作
// 创建一个Node节点
Node<K,V> newNode(int hash, K key, V value, Node<K,V> next){...}
// 创建树节点
TreeNode<K,V> newTreeNode(int hash, K key, V value, Node<K,V> next) {...}
// 树节点和普通节点相互转换
Node<K,V> replacementNode(Node<K,V> p, Node<K,V> next) {...}
TreeNode<K,V> replacementTreeNode(Node<K,V> p, Node<K,V> next) {...}


// HashMap未实现,留给LinkedHashMap实现
// 后置处理
// 访问节点后如何处理
void afterNodeAccess(Node<K,V> p) { }  
// 插入节点后如何处理
void afterNodeInsertion(boolean evict) { }  
// 移除节点后如何处理
void afterNodeRemoval(Node<K,V> p) { }

afterNodeAccess 、 afterNodeInsertion 、 afterNodeRemoval 这三个方法保证了 LinkedHashMap 有序,分别会在 get 、 put 、 remove 后调用

put 和 remove 都对顺序没有影响,因为在操作的时候已经调整好了(put放在)。但是 get 是对顺序有影响的(被访问到了),所以需要重写该方法:

public V get(Object key) {  
    Node<K,V> e;  
    // 获取节点
    if ((e = getNode(hash(key), key)) == null)  
        return null;  
    // 改变顺序
    if (accessOrder)  
        afterNodeAccess(e);  
    return e.value;  
}

通过 afterNodeAccess 来改变该节点(P)的顺序,该方法分为一下几步:

  1. 拆除需要移动的节点P
  2. 处理前置节点,前置节点有两种情况
    1. 前置节点为空,表示P为头节点
    2. 前置节点不为空,表示P为中间节点
  3. 处理后置节点
    1. 后置节点为空,表示P为尾节点
    2. 后置节点不为空,表示P为中间节点
  4. 将该节点移动到 tail 处
void afterNodeAccess(Node<K,V> e) { // move node to last  
    LinkedHashMap.Entry<K,V> last;  
    if (accessOrder && (last = tail) != e) {  
        LinkedHashMap.Entry<K,V> p =  
            (LinkedHashMap.Entry<K,V>)e, b = p.before, a = p.after;  
        p.after = null;  
        if (b == null)  
            head = a;  
        else  
            b.after = a;  
        if (a != null)  
            a.before = b;  
        else  
            last = b;  
        if (last == null)  
            head = p;  
        else {  
            p.before = last;  
            last.after = p;  
        }  
        tail = p;  
        ++modCount;  
    }  
}

afterNodeInsertion 则在 putVal 中调用

基本逻辑是如果参数为 true 则尝试删除头节点,但是还需要满足头节点是最'老'的,具体的与 removeEldestEntry 配合使用,可以继承 LinkedHashMap 并定制, LinkedHashMap 是恒为 false 的。

protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {  
    return false;  
}

如果所有条件都满足则删除头节点

void afterNodeInsertion(boolean evict) { // possibly remove eldest  
    LinkedHashMap.Entry<K,V> first;  
    if (evict && (first = head) != null && removeEldestEntry(first)) {  
        K key = first.key;  
        removeNode(hash(key), key, null, false, true);  
    }  
}

afterNodeRemoval 则在 removeNode 成功删除节点之后调用:

用来保证在双向链表中删除一个节点仍然能够使结构不被破坏

为被删除节点的头和尾节点建立联系:

void afterNodeRemoval(Node<K,V> e) { // unlink  
    LinkedHashMap.Entry<K,V> p =  
        (LinkedHashMap.Entry<K,V>)e, b = p.before, a = p.after;  
    p.before = p.after = null;  
    if (b == null)  
        head = a;  
    else  
        b.after = a;  
    if (a == null)  
        tail = b;  
    else  
        a.before = b;  
}

应用

实现LRU

LRU是一种缓存置换机制,LRU (Least Recently Used)将最近最少使用的内容替换掉。实现非常简单,每次访问某个元素,就将这个元素浮动到栈顶。这样最靠近栈顶的页面就是 最近经常访问 的,而被压在栈底的就是 最近最少使用 的,只需要删除栈底的元素。

LinkedHashMap 非常方便实现LRU, LinkedHashMap 在 put 操作时同时会判断是否需要删除最'老'的元素。只需要重写 removeEldestEntry 方法,使得超过容量就删除最'老'的元素。

下面是具体实现:

public class LRU<K, V> extends LinkedHashMap<K, V> {  
  
    /**  
     * 最大容量  
     * <p>  
     * Note: 用位运算就不需要将十进制转换为二进制,直接就为二进制。  
     */  
    private final int MAX_CAPACITY = 1 << 30;  
  
    /**  
     * 缓存的容量  
     */  
    private int capacity;  
  
    public LRU(int capacity) {  
        this(true, capacity);  
    }  
  
    public LRU(boolean accessOrder, int capacity) {  
        this(1 << 4, 0.75f, accessOrder, capacity);  
    }  
  
    public LRU(int initialCapacity, float loadFactor, boolean accessOrder, int capacity) {  
        super(initialCapacity, loadFactor, accessOrder);  
        this.capacity = capacity;  
    }
}

测试:

LRU<Integer, Integer> lru = new LRU<Integer, Integer>(10);  
	for (int i = 0; i < 10; i++) {  
	    lru.put(i, i * i);  
	    System.out.println("put: (" + i + "," + i * i + ")");  
	    int randomKey = (int) (Math.random() * i);  
	    System.out.println("get "+randomKey+": " + lru.get(randomKey));  
	    System.out.println("head->"+lru+"<-tail");  
	}

结果:

put: (0,0)
get 0: 0
head->{0=0}<-tail
---------------
put: (1,1)
get 0: 0
head->{1=1, 0=0}<-tail
---------------
put: (2,4)
get 1: 1
head->{0=0, 2=4, 1=1}<-tail
---------------

 

Java - LinkedHashMap 首尾元素高效获取:从迭代到反射的性能与安全权衡 本文深入探讨了Java中LinkedHashMap高效获取首尾元素的多种方法,包括迭代器、数组转换、Stream API和反射方案。通过性能测试数据对比,分析了各方案的优缺点,并提供了针对不同场景的选型建议。特别强调了反射方案在性能与安全之间的权衡,为开发者实现有序map操作提供了实用指导。 阅读详情

相关推荐

AI Agent开发实战:100个真实场景题库解析

AI Agent开发涉及复杂的需求理解、架构设计及安全防护等关键技术环节。在工程实践中,开发者常面临需求偏差、系统崩溃等挑战,特别是在金融、医疗等高要求场景下。通过真实案例题库,开发者能系统性地掌握需求分析、架构决策树建模(如向量数据库选型)、安全攻防策略(如提示词注入防御)等核心技能。这些实战经验不仅能提升Agent的可用性和安全性,还能优化其在电商客服、智能家居等场景中的表现。题库采用动态难度系统,覆盖从基础到高级的开发挑战,是AI工程化落地的重要参考。

weixin_29057695的博客 345

jdk1.8正常运行,而高版本jdk17运行报错 java.lang.reflect.InaccessibleObjectException

jdk1.8正常运行,而高版本jdk运行报错 java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.util.HashMap$Node[] java.util.HashMap.table accessible: module java.base does not “opens java.util” to unnamed module @200a570f, 解决方法:(针对于Idea2021.3

危楼高百尺 1万+

VisionPro 9.0 QuickBuild里用C#脚本调用Halcon 23.11模型,保姆级图文配置流程

本文详细介绍了如何在VisionPro 9.0 QuickBuild环境中使用C#脚本调用Halcon 23.11深度学习模型,提供从环境配置到模型集成的保姆级图文教程。重点解决图像格式转换、许可证配置等工业视觉检测中的常见问题,帮助开发者快速实现高效、稳定的视觉检测流水线部署。

weixin_27027459的博客 435

使用cglib出现 java.lang.reflect.InaccessibleObjectException

jdk1.8正常运行,而高版本jdk运行报错 java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.util.HashMap$Node[] java.util.HashMap.table accessible: module java.base does not “opens java.util” to unnamed module @200a570f,

qq_34564959的博客 713

高速PCB设计中的一些常用规则

目前,高速PCB产品设计中,高速接口的应用日益普及,对于复杂的设计而言,高速走线就如同“蜘蛛网”一样密布在PCB各处,因此,在进行PCB检查及评审时,必要的高速PCB设计经验法则及规则是工程师开展工作必不可少的知识储备。

一只豌豆象的博客 3415

rk3568 点亮双LVDS 屏

承接文章《rk3568点亮LCD(lvds)》中仅仅只能使用亮单LVDS;经过厂商的努力,陆续发布新补丁。目前支持双lvds显示,缺憾是需要自己额外移植相关补丁。受限于通信频率和VOP编码能力,支持最大分辨仍然是1920x1080、60fps。

weixin_35723192的博客 3008

运行Spark编程报错Unable to make field transient java.lang.Object[] java.util.ArrayList.elementDataaccessib

IDEA运行Spark编程报错Unable to make field transient java.lang.Object[] java.util.ArrayList.elementData accessible: module java.base does not “opens java.util” to unnamed module @d2de489或者module java.base does not "opens java.util.concurrent 等等,跟这种类似的报错情况的话。

fengzhimohan的博客 1008

【OpenClaw从入门到精通】第07篇:2026实测!零基础开发OpenClaw自定义Skill——招聘外呼自动邀约完整教程

本文聚焦OpenClaw自定义Skill开发全流程,针对现成技能无法满足个性化场景(如专属招聘流程、内部系统对接)的痛点,以“招聘外呼自动邀约”为实战案例,从概念认知、环境搭建、分步开发到测试优化,手把手教读者从零构建自定义Skill。内容涵盖Skill目录结构、SKILL.md核心配置、Python主逻辑实现、API对接、安全配置等关键环节,融入2026年ClawHavoc事件安全警示,强调最小权限、凭证安全等开发原则。所有代码经实测可运行,步骤详尽且兼顾新手友好与进阶需求。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 1193

java.util.LinkedHashMap cannot be cast to com.alibaba.fastjson.JSONObject分析

1. 测试接口 @Data public class Content { private JSONArray content; } @Data public class Account{ private String accountNo; private String accountName; } @PostMapping("/test") public RetResult<Content> test(@RequestBody Content content) {

m0_37539286的博客 1万+

【ACP】2025-最新-疑难题解析- 练习一汇总

他们对您的方案比较满意,作为一个特别看重用户体验的创业公司,他们有一个比较担心的问题:在后端云服务器 ECS 实例相对空闲时,可能会触发减少 ECS 实例的伸缩活动,这时候运行在即将移出伸缩组的 ECS 实例上的应用会被终止,那么发起这些应用的用户的体验会变差。:在使用阿里云的负载均衡 SLB 实例时,做了如下健康检查的配置:响应超时时间为 5 秒,健康检查间隔为 2 秒,不健康阈值为 3,健康阈值为 3,即对于确认一个后端服务器 ECS 实例是健康的,需要连续三次得到正常响应。以下说法哪一项是正确的?

jundao1997的专栏 326

SOUL.md 人格定制的 7 个高阶技巧:Hermes Agent 精准控制 AI 行为模式

揭示 SOUL.md 的本质是行为契约而非人格设定,介绍7个围绕边界约束的高阶技巧,包括用上下文锚点(INPUT SCOPE/OUTPUT TARGET/CONSTRAINTS)替代角色描述、动态渲染锚点适配CI流程等,显著降低token消耗与人工review耗时。

weixin_42520239的博客 251

Java源码分析——java.util工具包解析(三)——HashMap、TreeMap、LinkedHashMap、Hashtable类解析

Map,中文名字映射,它保存了键-值对的一对一的关系形式,并用哈希值来作为存贮的索引依据,在查找、插入以及删除时的时间复杂度都为O(1),是一种在程序中用的最多的几种数据结构。Java在java.util工具包中实现了Map接口,来作为各大Map实现类的规范,其中主要的Map实现类有三个,分别是:HashMap、TreeMap以及LinkedHashMap类

溯夜,逆流而上 408

C#上位机+YOLOv8实战:摄像头/视频流实时目标检测(工业级优化+完整可运行源码)

纯C#实现,无Python依赖,适配工业工控机部署;工业级优化:解决帧率、内存、鲁棒性三大核心问题;代码完整可复用,支持摄像头/视频流/RTSP多源检测;避坑指南覆盖开发中90%的常见问题,降低落地成本。相较于传统方案,该方案兼顾实时性与易用性,成本仅为商用视觉库的1/10,可快速落地到工业质检、安防、物流等场景。后续可拓展方向包括:自定义数据集训练、GPU加速推理、工业通信(PLC/串口)对接等。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 733

ClassCastException: java.util.LinkedHashMap cannot be cast to com.example.demo.bean.DepartmentInfo

JSONObject对象在代码里边强制转换List对象数组成功,但是在后续循环遍历的时候报java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.example.demo.bean.DepartmentInfo错误 若上面看不懂,不知怎么解决,可以看这个链接,我就通过看这个解决的(https://bl...

weixin_43060346的博客 1522

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

java set底层_Java底层源码解析·容器篇——Set

该系列主要介绍java.util包下的各种容器。传送门:先来一张java.util包下容器的分类图:Set实现了Collection接口,它有三种容器实现:HashSet,LinkedHashSet和TreeSet。Set接口相较于Collection接口,几乎没有新增的方法。这三种Set的实现,主要区别在于使用迭代器进行遍历的时候,遍历元素的顺序不同。HashSet:没有顺序LinkedHash...

weixin_29408063的博客 370

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Java进阶总结——集合

说明:对于以上的框架图有如下几点说明1.所有集合类都位于java.util包下。Java的集合类主要由两个接口派生而出:Collection和Map,Collection和Map是Java集合框架的根接口,这两个接口又包含了一些子接口或实现类。集合接口:6个接口(短虚线表示),表示不同集合类型,是集合框架的基础。抽象类:5个抽象类(长虚线表示),对集合接口的部分实现。可扩展为自定义集合类。实现类:8个实现类(实线表示),对接口的具体实现。Collection 接口是一组允许重复的对象。

m0_74824845的博客 664

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

java.util.LinkedHashMap cannot be cast to Entity

前后端数据传输转换问题-java.util.LinkedHashMap cannot be cast to Entity 问题场景:项目前端使用json传输方式,后台接收后对象变成了LinkedHashMap @ResponseBody @RequestMapping(value = "/batchCharge.do",method ={RequestMethod.POST,RequestMethod.GET}) public Response batchCharge(@Req

luoqinglong的专栏 1887

14 java.util.LinkedHashMap

LinkedHashMap 2015.01.28 By 970655147 备注 : “[” 和”]”之间的内容是 我添加的Map 接口的哈希表和链接列表实现,具有

970655147的专栏 2998

【JDK源码阅读9-util】Map接口之LinkedHashMap

LinkedHashMap接口 一、类继承关系 public class LinkedHashMap extends HashMap implements Map 二、LinkedHashMap接口特点    与HashMap的异同:同样是基于散列表实现,          区别是LinkedHashMap

noaman_wgs的博客 3172

Java内存溢出分析

1 查看内存中对象数量及大小 #查看所有对象,包括活跃以及非活跃的 jmap ‐histo <pid>|more #只查看活跃对象 jmap ‐histo:live <pid>|more 例 num #instances #bytes class name ------------------------------------------...

Dack的博客 2201

ExcelAnalysisException: class java.util.LinkedHashMap cannot be cast to

Caused by: java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.kaki.serviceedu.entity.excel.SubjectData (java.util.LinkedHashMap is in module java.base of loader ‘bootstrap’; com.kaki.serviceedu.entity.excel.SubjectData

Kaaaakaki的博客 2964

Java之LinkedHashMap

—————————————————————————————————————————————— 一、类的继承和实现关系: public class LinkedHashMap  extends HashMap implements Map —————————————————————————————————————————————— 二、构造方法摘要: LinkedHashMap

未来,你好! 864
上一篇: kubernetes之Deployment
下一篇: 快速搭建一个网关服务,动态路由、鉴权的流程,看完秒会(含流程图)
JavaShark
博客等级 码龄4年 184粉丝 438原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值