Codelytics

Visualise your geek speak

  • Blog
  • Terms
  • Privacy
  • Contact

LinkedHashMap Tutorial

September 9, 2018 by Adrian Bartlett Leave a Comment

java.util.LinkedHashMap stores Key Value pairs like java.util.HashMap, and enables the retrieval of a Value given a Key.  LinkedHashMap differs from HashMap in that the Keys are ordered by their insertion order. LinkedHashMap maintains a double-linked list to determine insertion order.

This tutorial, complete with an easy to understand and interactive UML visualization, explains how LinkedHashMap works.

[Read more…]

Filed Under: Collections, Java Tagged With: Collections, Hashmap, Hashmap Tutorial, Java, java.util.Map series, LinkedHashMap

java.util.TreeMap visualized: interactive view from a new perspective

September 6, 2018 by Adrian Bartlett Leave a Comment

java.util.TreeMap stores Key Value pairs like java.util.HashMap, and enables the retrieval of a Value given a Key.  TreeMap differs from HashMap in that the Keys are ordered by their natural order.  Internally the TreeMap maintains a Tree data structure, used to order and locate keys.

This tutorial, complete with an easy to understand and interactive UML visualization, explains how TreeMap works.

[Read more…]

Filed Under: Collections, Java Tagged With: Collections, Hashmap, Hashmap Tutorial, java.util.Map series, TreeMap

Constructor & Setter Dependency Injection

September 1, 2018 by Adrian Bartlett Leave a Comment

If you were asked in an interview: “What types of bean injection are there in Spring”. What would your answer be?

There are two types of bean injection in Spring: Setter-based dependency injection (DI) and Constructor-based dependency injection…
[Read more…]

Filed Under: Blog posts, Java, JPA, Spring Tagged With: Java, Spring

4 Reasons to use a Java Semaphore

June 29, 2015 by Adrian Bartlett Leave a Comment

Why is a Java Semaphore useful?  Today I’ll tell you the four reasons why a Java Semaphore is useful.

4 reasons to use Java's Semaphore

[Read more…]

Filed Under: Blog posts, Concurrency, Java Tagged With: Collections, Concurrency, Java, Semaphore

Java 8: How To Retrieve Absent Values From HashMap

April 15, 2015 by Adrian Bartlett Leave a Comment

When attempting to retrieve a value from a Map which doesn’t exist, often it is desirable for the Map to provide an initial value. This saves the developer adding in extra logic to detect, create and insert the initial value. Java 8 adds a new Map method… [Read more…]

Filed Under: Collections, Java Tagged With: Collections, Hashmap, Hashmap Tutorial, Java, java.util.Map series

How to Improve HashMap Performance

April 15, 2015 by Adrian Bartlett Leave a Comment

Providing a good implementation of java.lang.Object::hashCode, is essential to HashMap performance.

This tutorial, complete with a source code visualization, describes how HashMap performance can be improved…

How to improve your hashmap performance

[Read more…]

Filed Under: Collections, Java Tagged With: Collections, Hashmap, Hashmap Tutorial, Java, java.util.Map series

8 Visual Steps to HashMap Enlightenment

April 11, 2015 by Adrian Bartlett Leave a Comment

The Java collection class, java.util.HashMap enables the storage of Key Value pairs.  Given a Key, the HashMap enables the associated Value to be efficiently retrieved.

This tutorial, complete with an easy to understand UML visualization, explains how HashMap works.

[Read more…]

Filed Under: Collections, Java Tagged With: Collections, Hashmap, Hashmap Tutorial, Java, java.util.Map series

How to Synchronize Threads – Use CountDownLatch

March 18, 2015 by Adrian Bartlett Leave a Comment

Concurrency in non-trivial systems is difficult. java.util.concurrent. CountDownLatch is one of my favourite concurrent core Java classes, because it simplifies the synchronization of threads. This class is useful when you want to wait until some task in another thread completes, before continuing in the current thread.

Synchronized swimmers - Greg Neate - https://www.flickr.com/photos/neate_photos/3522905573/in/photostream/

[Read more…]

Filed Under: Concurrency, Java Tagged With: Concurrency, CountDownLatch, Java

  • Facebook
  • Google+
  • Twitter
  • YouTube

Subscribe to the blog

Recent posts

  • LinkedHashMap Tutorial
  • java.util.TreeMap visualized: interactive view from a new perspective
  • Constructor & Setter Dependency Injection
  • 4 Reasons to use a Java Semaphore
  • Java 8: How To Retrieve Absent Values From HashMap

Search

  • Blog
  • Terms
  • Privacy
  • Contact

All website content, including software, (excluding that owned by Wordpress and Centric Theme on Genesis Framework) is owned by Codelytics Pty Ltd and/or its affiliates, all rights reserved and protected by Australian copyright laws and relevant international treaty provisions. Any reproduction, redistribution and/or reverse engineering is expressly prohibited. For further details see the terms and conditions page on this site.
© Codelytics Pty Ltd, Adrian Bartlett, 2013

Copyright © 2022 · Centric Theme on Genesis Framework · WordPress · Log in