Skip to content

Instantly share code, notes, and snippets.

View aditya-agrawal's full-sized avatar

aditya-agrawal

View GitHub Profile
@aditya-agrawal
aditya-agrawal / FuturesB.java
Created July 24, 2020 02:30 — forked from benjchristensen/FuturesB.java
FuturesB.java Example of using Futures for nested calls showing how it blocks inefficiently.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@aditya-agrawal
aditya-agrawal / java8Blog.txt
Last active November 13, 2017 08:38
Introduction to Java8
Java 8 has been the most awaited and is a major feature release of Java. I have tried to cover some of the feature in this blog.
Default Methods for Interfaces:-
Java 8 enables us to add non-abstract method implementations to interfaces by utilizing the default keyword.
Example - This functionality can reduce a lot of code of duplication in case more than one has same implementation.
We can just define it as default and only in case of different implementation override the method.
interface A {
void method1(int a);