Default Method

interface A { void show(); } interface A { void show(); } Is it ‘A’ is the valid interface ? Yes since it has only abstract method. interface B { void show(){ System.out.println(“show”); } } interface B { void show(){ System.out.println(“show”); } } Is it ‘B’ is the valid interface ? No because interface should […]

Share this article on

Double Colon Operator in Java 8

Double Colon Operator is used as a method reference by replacing lambda expression. Syntax : className::methodName() className::methodName() Its applicable only in the place where lambda is applicable(means only for functional interface implementaions). Let’s analyze with the below program package com.kb.doublecolon;   public class RunnableEx1 {       static void show(){         […]

Share this article on
Next >