Hi all, please find your Java newsletter below. The Java Insights newsletter is coming on Sunday, as always. 🚀

🔥 Top Java Posts

Project Lilliput: reducing the object header size

Project Lilliput has two main goals, reduce the object header size and make the header layout more flexible. Learn more >>

What makes Java so great after 25 years

Java enthusiasts share their opinions on what makes Java so great after 25 years Some highlights are the libraries, stability and the JVM. Learn more >>

🖱️ Just Click It

  1. Quality Outreach Heads-up – JEP 425 Virtual Threads (preview) Testing
  2. Using Java’s Project Loom to build more reliable distributed systems
  3. Proposal: openjdk.java.net ➜ openjdk.org
  4. Project Leyden: Beginnings
  5. JDK 18 Security Enhancements
  6. How CIOs Can Ensure Innovation, Longevity, and Security in Java Application Development
  7. From Java/JDK 7+ and Project Coin over Project Amber to Better Java Serialisation

🤖 Java Interview Questions

  1. How can you employ inheritance in Java? What is one example where you would use inheritance?
    • It is possible to employ inheritance in Java by using the keyword extends. In that process a superclass is extended by a subclass. The class access modifier plays a role in that process. Classes having the private access modifier can not be extended.
    • One example on which inheritance can be employed is when one wants to represent a mobile device and some specializations which carry their own properties. For example, the class MobileDevice is the superclass of the class Smartphone and the class Tablet.
  2. What is the difference between the String, StringBuilder and StringBuffer classes? Mention one use case of which one of those?
    • String is an immutable class that represents character strings. By using the String class,  a new object is created every time when there is a modification on the value of the string. One use case for the String class is to create an object that will represent a string value which will not change constantly across the execution of a program.
    • StringBuilder is a mutable sequence of characters that do not provide guarantees of synchronization. One use case for the StringBuilder class is to create an object that will represent a string facing constant change across the execution of a program, without being accessed concurrently. Since StringBuilder is mutable and does not require a new object creation every time there is a change, it tends to perform better than String for concatenation and other operations that require constant change to a string value.
    • StringBuffer is a thread-safe, mutable sequence of characters. One use case for the StringBuffer class is to create an object that will represent a string used by multiple threads with constant change across the execution of a program. Since it provides guarantees to support concurrent access, the StringBuffer class tends to be slower than StringBuilder.

❓StackOverflow Java Question

  1. How to create a sorted map from a list?
  2. What is the difference between JRE and JDK?

⚙️ New Releases

Previous Editions