Hi all, please find your Java newsletter below. The Java Insights newsletter is coming on Sunday, as always. 🚀
🔥 Top Java Posts
Java Language Futures
Java Language Futures
A tour of recent and future changes in the Java Programming Language. Checkout the features you’ll be using soon. Learn more >>
Project Loom: Java Virtual Threads
A close look at Project Loom, which proposes virtual threads for the Java Programming Language. Project Loom is under preview and is documented in JEP 425. Learn more >>
🖱️ Just Click It
- Quarkus Dev Services, jOOQ, Flyway, and Testcontainers: A Full Example
- CVE-2022-21449: Psychic Signatures in Java
- Does Java 18 Finally Have A Better Alternative To JNI?
- Java on Visual Studio Code Update – April 2022
🤖 Java Interview Questions
- In which situation would you use a
LinkedList
instead of anArrayList
?- A common situation would be when add operations are common and the size of the list is not known ahead of time and read operations are not common. Add operations are cheaper in
LinkedList
compared toArrayList
. One factor is that when anArrayList
reaches its capacity, it needs to be resized by being copied into a new array. On the other hand, using aLinkedList
tends to consume more memory and you can’t access elements in O(1) if the element is not in the head.
- A common situation would be when add operations are common and the size of the list is not known ahead of time and read operations are not common. Add operations are cheaper in
- You need to create a
HashMap
to store a large pre-defined amount of mappings. How can you improve the chances of mappings in thatHashMap
to be stored more efficiently?- One way to increase the chances of store mappings more efficiently is to create the
HashMap
instance with sufficiently large capacity instead of relying on the automatic rehashing to grow the table. Learn more
- One way to increase the chances of store mappings more efficiently is to create the