How To Convert double To int In Java?

In this article, we will see how we can convert a double to an int.

In Java programming, you will have a double primitive value (ex 82.14), but to do the further operations you need an int value (ex. 82) so let’s see how to convert double to int in Java.

Java Streams: An Implementation Approach

In this tutorial, we will learn what Streams are in Java and how we can develop an implementation approach. We will compare the Stream API to SQL statements as an implementation approach.

Audience

All Java Developers who want to learn the new feature of Java 8 i.e. Streams API.

Strengthening Testing through Mutation: A DevOps Engineer’s Experience

I work as a DevOps engineer for a large public-facing application, which has around 90+ microservices (Java-based). Consistently, we are hit by scenarios that we’d discover in the field, which were not caught in any of our testing. Despite improving our test strategies and code coverage assessments, we were unable to assess the "strength" of our test cases.

We looked around for options and solutions that could help us to be more sure about our test cases and the code we develop. As a DevOps engineer, my responsibility was to identify options and trial them to fix this problem and include it as part of our automated build process.

HashMap: get() Vs. getOrDefault()

When a developer is working on a module, they always come across some form of data structure, like set, queue, list, etc. Data structures are used for storing Java objects in a certain fashion so that they are easy to retrieve when needed.

You may also like: How HashMap Works in Java

The right data structure makes functionality more efficient and effective — otherwise, it would be a nightmare as the implementation expands. You can start with a Map of one of the data structures where objects are stored in the key-value format. And with the help of key, we can easily retrieve the value in time complexity of O(1).

Optional.orElse() Vs. Optional.orElseGet()

Learn more about programming Java Optionals

A very common misunderstanding, as well as bad usage, can prevail if you simply go by the dictionary and semantic definition of Optional.orElse() and Optional.orElseGet().

A smart man makes a mistake, learns from it, and never makes that mistake again. But a wise man finds a smart man and learns from him and how to avoid the mistake altogether.

Java 8 Steaming (groupBy Example)

In this article, I would like to share few scenarios where we will see how the Java 8 Stream and related functions can be useful for reading a file and applying some aggregate functions, which we generally do in our day-to-day SQL/queries on the database side.

So, I am taking an example of employee CSV files, which is shown below:

ArrayList or LinkedList?

This article provides guidance to Java developers in choosing the appropriate sequential data structure.

ArrayList and LinkedList are two classes of the Java Collection Framework used for storing lists of object references. ArrayList and  LinkedList both implement the List interface. Let's first try to understand their most important parent interface List (which).

Tascalate Concurrent — Filling the Gaps in CompletableFuture API (Part 1)

The Tascalate Concurrent library provides an implementation of the CompletionStage interface and related classes. These are designed to support long-running blocking tasks (typically, I/O bound). This functionality augments the sole Java 8 built-in implementation, CompletableFuture, that primarily supports computational tasks. Also, the library helps with numerous asynchronous programming challenges like handling timeouts, retry/poll functionality, orchestrating results of multiple concurrent computations, and similar.

The library is shipped as a multi-release JAR and may be used both with Java 8 as a classpath library or with Java 9+ as a module.