Java 8 Interview Q&A #java8 #interview #javatechie #shorts #youtube

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Please create many such sorts.
U r already a hit, this effort will multifold many things

AvinashKumar-mhsi
Автор

I2 will not be functional interface because after inheritance I2 have 2 abstract method (M1, M2)

amandokania
Автор

I1 is a functional interface it have only one abstract method but I2 is not functional interface it have 2 abstract methods m1() and m2().

praveensiddavatam
Автор

For sure, I2 is not a functional interface as it extends another interface which has an abstract method. But I1 work as Function interface, And Its recommended to add @FunctionalInterface annotation as it leads to ambiguity while compilation may results runtime error in future.

gameofnoobgon
Автор

If the I2 annotated as FunctionalInterface then It will through compile error .
It is possible but i2 no longer be a functionalInterface

afrozkhan.
Автор

We can't annotate l2 as @functionInterface, cause compiled time error

arvinsuryavanshi
Автор

Yes it will behave as functional interface even after extending.

ruksads
Автор

yes indeed it is tricky.. this question was asked when i was attending an interview session for an internship 3 yrs back...

crimsonx_
Автор

Interface I2 is not a functional interface itself contains one abstract method and again its extends fronm i1 interface which is also hving its own abstract indirectly i2 interface is having 2 abstract method and thus we cant call it as functional interface

dipalijibhakate
Автор

This code will be compiled but I2 interface would be a simple interface instead of functional interface

Aniruddhdwivedi
Автор

I2 will no longer be a functional interface, as when it extends the interface I1, it will have one more abstract method, m1(), along with m2(), which breaks the rule for functional interfaces. i.e., a functional interface must have one and only one abstract method.

paulsofts
Автор

Here I1 is a functional interface as it contains only one abstract method where as I2 is not because it extends the I1 and have two abstract methods.

Note : Functional interface is an interface which contains only one abstract method. It can have any number of static and default methods.

User_xyz_
Автор

No, bcoz a functional interface should contain only one abstract method directly or indirectly

MinatiSona
Автор

I1 is functional but I2 is not. London ❤

grrlgd
Автор

No since there is more than one abstract method

maayyu
Автор

No, because now it will have 2 abstract method to implement

bhuvaneshvarsrivastava
Автор

I2 is not gonna be a functional interface becoz it has 2 abstract method.

sabyasachirajkumar
Автор

No it can't be functional coz of extended property of parents interface.

AsadAhmad-hdgn
Автор

We will get the compilation error ..as the functional interface will not extends the another functional interface ..but it can extends if the interface have default or static methods.

rajeshroyal
Автор

I2 can implement I1. Extends keywords is used for class.

sharesolutions
join shbcf.ru