Monday, January 31, 2022

The best HotSpot JVM options and switches for Java 11 through Java 17

The best HotSpot JVM options and switches for Java 11 through Java 17In this article, you will learn about some of the systems within the OpenJDK HotSpot Java Virtual Machine (HotSpot JVM) and how they can be tuned to best suit your program and its execution environment.The HotSpot...

Wednesday, January 26, 2022

Simpler object and data serialization using Java records

Learn how you can leverage the design of Java’s records to improve Java serialization.Record classes enhance Java’s ability to model plain-data aggregates without a lot of coding verbosity or, in the phrase used in JEP 395, without too much ceremony. A record class declares some immutable state and...

Monday, January 24, 2022

Java: Why a Set Can Contain Duplicate Elements

In low-latency applications, the creation of unnecessary objects is often avoided by reusing mutable objects to reduce memory pressure and thus the load on the garbage collector. This makes the application run much more deterministically and with much less jitter. However, care must be taken as to how...

Friday, January 21, 2022

Compile Time Polymorphism in Java

Polymorphism in Java refers to an object’s capacity to take several forms. Polymorphism allows us to perform the same action in multiple ways in Java.Polymorphism is divided into two types:1. Compile-time polymorphism2. Run time polymorphismNote: Run time polymorphism is implemented through Method overriding. Whereas, Compile Time polymorphism is...

Wednesday, January 19, 2022

Quiz yourself: Java abstract classes and access modifiers for abstract methods

It’s essential to declare classes properly to ensure methods are accessible.Download a PDF of this articleYour software uses two classes that are part of the Object Relational Mapping (ORM) framework.package orm.core;public abstract class Connection {  abstract void connect(String url);  }package orm.impl;import orm.core.Connection;public abstract class DBConnection extends Connection {  protected...

Monday, January 17, 2022

12 handy debugging tips from Cay Horstmann’s Core Java

From using jconsole to monitoring uncaught exceptions, here are a dozen tips that may be worth trying before you launch your favorite IDE’s debugger.Download a PDF of this article[This article on Java debugging is adapted from Core Java Volume I: Fundamentals, 12th Edition, by Cay S. Horstmann, published...

Wednesday, January 12, 2022

Java Program to Find the Biggest of 3 Numbers

A Simple Java Program To Find Largest Of Three Numbers.1. OverviewYou’ll be learning today how to find the biggest of 3 numbers. This is also a very basic interview question. But the interviewer will look for the optimized and fewer lines code. We will show you all the...

Pages (26)1234567 »