css 

JavaScript Calculator Example

In this tutorial, I will tell you two ways to make a calculator using basic HTML, CSS and JavaScript. In first way we make functions for all operations and in the second we use some inbuilt global function to make a calculator. In both cases we are going to add some simple math operations like addition, subtraction, multiplication, division in our basic calculator. This project will help you to improve your logical ability and coding skills. JavaScript Calculator Example Method 1: Mainly the functions that we need to work for…

Read More
java 

How to Remove a Key, Value, or Entry from an HashMap in Java 8 – Example Tutorial

In the last article, I have shown how to remove key/value pairs from a map in Java based upon some conditions like remove all entries where values are greater than some values. I have told you that you must use the Iterator's remove() method for removing mapping while iteration to avoid ConcurrentModificationException, but that's not required anymore in Java 8. From JDK 8 onwards, you can selectively remove mapping without iterating over Map. The JDK 8 API has added several new methods to existing interfaces e.g. java.util.Collection, java.util.Map, Comparator etc…

Read More

Retrofit 2 – Service generator example

Though we can easily create Retrofit instances on demand for different client in place, having a dedicated factory method or service generator method is definitely desirable. In this service generator, we can have centralized place to add/modify the authentication, logging and error handling logic. 1. Retrofit service generator A service generator class defines one method […] The post Retrofit 2 – Service generator example appeared first on HowToDoInJava.

Read More

How to Create a Good MCVE (Minimal Complete Verifiable Example)

Reporting a bug takes time, and trust me, every vendor appreciates your reporting of a bug! Your voice counts as many voices, for all the other customers of a product who do not want to or cannot take the time to report the same bug are numerous. So, first off, thanks for taking that time and reaching out to us vendors. We really appreciate your help! Having said so, reporting a bug can be a tedious exercise. For both parties, the one reporting the bug and the one receiving it.…

Read More
java 

How to use filter + map + collect + Stream in Java? Example Tutorial

Hello guys, many of my readers emailed me to write a post about the map and filter function of Java 8 because they found it difficult to understand and use. Even though I have previously blogged about both map() and filter(), I am writing this post again to explain the concept in more layman's language for a better understanding of my readers and fellow Java developers. The map() function is a method in Stream class which represents a functional programming concept. In simple words, the map() is used to transform…

Read More