Quantcast
Channel: Java Archives - Java Code Geeks
Browsing all 745 articles
Browse latest View live

Java’s Performance and Efficiency with GraalVM

For decades, Java has reigned supreme in enterprise development, renowned for its robustness and rich ecosystem. However, traditional Java applications can sometimes struggle with startup times and...

View Article


Custom Field Names with @SerializedName in Gson

Gson is a popular Java library for converting Java objects to their JSON representation and vice versa. One of the challenges developers often face is handling JSON field names that do not exactly...

View Article


Custom Field Name with @JsonProperty

1. Introduction Custom field name with @JsonProperty is very useful when mapping Java fields to JavaScript Object Notation (JSON) properties and vice versa. JSON is commonly used in web applications to...

View Article

How to exclude fields in Gson

Google Gson is a library for serializing and deserializing Java objects to and from JSON. Sometimes, it is necessary to exclude certain fields from the JSON output. Gson provides several ways to...

View Article

Project Valhalla: Boosting Microservices with the Future of Java

The microservices architecture has become a cornerstone of modern software development, offering agility, scalability, and ease of maintenance. However, traditional Java applications can sometimes...

View Article


Gson Support for Java 8 Date-Time Types

Java 8 introduced a robust date and time API with classes such as LocalDate, LocalDateTime, and ZonedDateTime. These classes provide an improved way to handle dates and times compared to the legacy...

View Article

Jackson Serialize and Deserialize LocalDate Example

1. Introduction Creating a custom serializer and deserializer via the Jackson library is a common task in Java applications. The LocalDate is an immutable date-time object that represents a date, often...

View Article

How to Traverse All Files from a Folder in Java

Traversing all files in a folder is a common task in Java, whether you need to read files, filter them based on certain criteria, or process them in some way. Java provides several ways to achieve...

View Article


Read and Write JSON to File with GSON

1. Introduction Using GSON to read and write json to file is easy with the fromJson and toJson APIs. GSON is an open-source library provided by Google for parsing and generating JSON. Here are the...

View Article


Compare Different Numeric Types in Java

Sometimes, we need to compare numbers regardless of their classes or types. This is particularly useful when the format is inconsistent, and the numbers might be used in various contexts. Let’s delve...

View Article

Print Distinct Characters from a String in Java

In Java, there are multiple ways to print distinct characters from a string. This article will explore three approaches: using Sets, Java Streams, and LinkedHashMap. Each method has its own advantages...

View Article

Intro to Gradle Lint Plugin

Overview Maintaining clean, efficient, and maintainable build scripts is essential for any project that uses Gradle. The Java Gradle Lint Plugin is a powerful tool that helps developers identify and...

View Article

Convert Float ArrayList to Primitive Array in Java

In Java, collections such as ArrayList<Float> are often used to store a dynamic list of objects. However, there might be scenarios where we need to convert this list of Float objects into a...

View Article


Int to short Conversion in Java

When working with Java, we frequently face situations that require converting data types to meet specific needs. A common example is converting an int to a short. Let’s delve into understanding the...

View Article

Handle Null Values In ArrayList.addAll()

The ArrayList class in Java is a commonly used data structure. One of its methods, addAll(), allows us to add all elements from a specified collection to the list. However, this method does not handle...

View Article


Helidon: A Modular Approach to Java Development

In the realm of Java development, monolithic applications are slowly becoming a relic of the past. The microservices architecture, with its focus on modularity, scalability, and independent...

View Article

10 Pillars of Clean Java Code

In the ever-evolving world of software development, crafting clean Java code is an essential skill. Clean code goes beyond functionality; it’s readable, maintainable, and fosters a collaborative...

View Article


assertEquals() vs. assertSame() in JUnit

JUnit is a widely used testing framework. Its API offers a straightforward approach to checking and comparing objects. However, the distinction between the assertEquals() and assertSame() methods is...

View Article

How to Use Pair With Java PriorityQueue

Java’s PriorityQueue is a data structure that allows us to store and retrieve elements in a specific order. This article explores how to use pairs with PriorityQueue and demonstrates how to use...

View Article

Unveiling the Magic of HashMaps in Java

Have you ever wondered how Java manages to efficiently store and retrieve information based on key-value pairs? The answer lies in a powerful data structure called the HashMap. In the world of...

View Article
Browsing all 745 articles
Browse latest View live