Home » Java » Core Java » Page 10

Core Java

7 JVM arguments of Highly Effective Applications

At the time (March 2020) of writing this article there are 600+ arguments that you can pass to JVM just around Garbage collection and memory. If you include other aspects, total JVM arguments count will easily cross 1000+. 😊. It’s way too many arguments for anyone to digest and comprehend. In this article, we are highlighting seven important JVM arguments ...

Read More »

Hands on Optional value

Optional is in air due to coronavirus, everything is becoming optional like optional public gathering , optional work from home, optional travel etc. I though it is good time to talk about real “Optional” in software engineering that deals with NULL reference. Tony Hoare confessed that he made billion dollar mistake by inventing Null. If you have not seen his ...

Read More »

How to create immutable Map in Java

Hello Friends, In this tutorial, we will see how we can create an immutable Map in Java. – What does it mean by immutable class or object? – What is an Immutable Map? – How to create an immutable Map in java? What does it mean by immutable class or object? An immutable class or object is a class or ...

Read More »

New features between Java 8 and Java 14

Since version 9, Java has new features every 6 months and it’s very hard to keep track of these new changes. Most of the information on the internet describes changes between the last 2 Java versions. However, if you’re in a similar situation as me, you’re not using the last Java version but a version several releases older. Then it’s ...

Read More »

Prefixed Naming

If you look at the source code of Takes or Cactoos for the first time, you most probably, like many others, will be triggered by the naming convention, which implies that most class names have two-letter prefixes: BkSafe, RqFake, RsWithStatus, TkGzip, and so on. To be honest, I haven’t seen a single Java developer who would be comfortable with this ...

Read More »

Call That An Exception?

While this is a Java example to do with testing and wiremock, it relates to a more universal problem. We were trying to retry Wiremock’s verify method, which may be called by our test before the endpoint we’re checking is hit. In that situation, we’d want to try again a few seconds later in a loop until timing out. Interesting, ...

Read More »

Mythematical Codey Code

Consider the following snippet: int max = 10; int a = 0; while (true) { // do a thing that may result in an early return if (++a >= max) { break; } } throw new RuntimeException("It ran out of attempts"); There are a few WTFs in the above. The loop’s a bit weird, the flow of control seems to ...

Read More »

ZeptoN is Putting Program into Java

1. Introduction The Java programming language or “Java” was introduced in 1995. Yet in the almost quarter-century it has added features not originally in the core language. Such features include enumerations, generics, many enhancements to the basic C-style functional switch statement, assertions, etcetera. Java is a programming language that has evolved over time to meet the needs of Java software ...

Read More »

Explode a WAR File Recursively

Abstract Ever need to explode a WAR file as well as exploding all JAR files in the WAR file? Ya, me too! I wrote ferris-war-exploder to explode either: A JAR fileA WAR file which every JAR file it finds also exploded.An EAR file with every JAR file (see #1) and WAR file (see #2) also exploded. Basically, ferris-war-exploder explodes anything ...

Read More »