Home » Java » Core Java

Core Java

OpenJDK on GitHub

Project Skara was created “to … investigate alternative SCM and code review options for the JDK source code, including options based upon Git rather than Mercurial, and including options hosted by third parties.” The OpenJDK skara-dev mailing list included a post from Robin Westberg last week that announced, “We have added some additional read-only mirrors of a few different OpenJDK ...

Read More »

How to create a QR Code SVG using Zxing and JFreeSVG in Java?

In this article, we will look at how to use the Zxing QR code generation library and JFreeSVG library to create a QR Code SVG image in Java. QR Code Generation The below code creates a java.awt.image.BufferedImage object representing QR Code using Zxing library: 1 public static BufferedImage getQRCode(String targetUrl, int width,     int height) {     try {         Hashtable<EncodeHintType, Object> hintMap ...

Read More »

How to Use Nutch From Java, Not From the Command Line

Apache Nutch is an open source framework written in Java. Its purpose is to help us crawl a set of websites (or the entire Internet), fetch the content, and prepare it for indexing by, say, Solr. A pretty useful framework if you ask me, however it is designed to be used onlymostly from the command line. You download the archive, ...

Read More »

Java Stream: Part 2, Is a Count Always a Count?

In my previous article on the subject, we learned that JDK 8’sstream()::count takes longer time to execute the more elements there are in theStream. For more recent JDKs, such as Java 11, that is no longer the case for simple stream pipelines. Learn how things have gotten improved within the JDK itself. Java 8 In my previous article, we could ...

Read More »

JDK 12 – JEP 325 Switch Expressions

JDK 12 went GA on March 19, 2019, keeping its word on shorter release cycles and frequent releases. The features part of the release can be found here. One of the interesting features for the developers is the “JEP 325 Switch Expressions” which is available as a preview feature. A preview feature as defined here is: A preview language or ...

Read More »

HashSet In Java

Introduction: HashSet in Java implements Set interface i.e. it doesn’t allow duplicates. It is internally backed by a HashMap which works on the principle of hashing.  We can store a null value in a HashSet. Its default capacity is 16 with a load factor of 0.75, where: Load factor = Number of Stored Elements / capacity A Java HashSet is non-synchronized. Also, ...

Read More »

Viewing TLS Configuration with JDK 13

JDK 13 Early Access Build 16 is now available and one of the interesting additions it brings is the ability to have the keytool command-line tool display the current system’s TLS configuration information. This is easier than trying to find supported TLS information in separate documentation and match that information to one’s JDK vendor and version. To see the TLS ...

Read More »

Variance in Java

The other day I came across this post describing what the author sees as pros and cons of Go after 8 months of experience. I mostly agree after working full time with Go for a comparable duration. Despite that preamble, this is a post about Variance in Java, where my goal is to refresh my understanding of what Variance is ...

Read More »