Thursday, March 29, 2018

How can instantiate Java interface without implementing.

public interface Foo { String method(); }
public class Claaa {
   public static void main(String[] args) {
    Foo fooByIC = new Foo() {
       @Override
       public String method() {
          return null;
       }
    };
  }

Answer: Inner class

Evolution Of Java Thread

Thread =>
   Concurrent Package(ExecutorService) =>
        ForkJoin(Internally uses concurrent package =>
           ParallelStream(internally uses fork join)

How can instantiate Java interface without implementing.

public interface Foo { String method(); } public class Claaa {    public static void main(String[] args) {     Foo fooByIC...