November 24, 2018

Create a simple counter in java 11, using java IntSupplier – Then test it using IntStream – a functional programming way.

We will create a simple counter in java. It will have a default initialization of 0. It will have a constructor, which can be used to set the seed value of this counter. It will implement Iterator interface It will implement IntSupplier interface package com.refactored.util; import java.util.Iterator; import java.util.function.IntSupplier; public class Counter implements Iterator<Integer>, IntSupplier […]

Read more