Java 8 || Default method() & Static method() inside Interface by Durga Sir

Java 8 || Default method() & Static method() inside Interface by Durga Sir

Durga Software Solutions

5 лет назад

194,590 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@578n.jhansisri5
@578n.jhansisri5 - 15.12.2023 11:14

Doubt: Sir, Let say I have need to write an interface with default method then Can I use abstract class? If yes then what is need for default methods concept in interfaces. If No then why?

Ответить
@lakshmaiahyannagiri291
@lakshmaiahyannagiri291 - 01.10.2023 13:52

Hi sir,
Present where your working

Ответить
@parishaguru8836
@parishaguru8836 - 27.03.2023 14:43

Interf.m1();// valid
// m1(); in valid
//Test.m1(); in valid
//Test t = new Test();
//t.m1(); in valid

Ответить
@rahuldhandhar6229
@rahuldhandhar6229 - 20.03.2023 10:51

Oracle should change the name of Java founder....it should be like "Java is developed by Durga sir".

Your knowledge, presenting in very simple words strategy makes layman can understand Java and no one can match you I m sure 😅.

You are doing really good work sir.
Thank so much for this.🙏🙏🙏🙏

Ответить
@top5things968
@top5things968 - 18.02.2023 10:13

Thank you Durga Sir .

Ответить
@tapanjeetroy8266
@tapanjeetroy8266 - 29.12.2022 17:38

Thank you sir!!

Ответить
@samee.62
@samee.62 - 26.12.2022 19:46

Sir i have been watching your video since 3 months and i can see my confidence has increased after watching you tutorial
Thanks sir keep supporting us

Ответить
@prasadmahakal2361
@prasadmahakal2361 - 28.11.2022 21:21

Thanks Sir.

Ответить
@devulechu6212
@devulechu6212 - 09.11.2022 14:24

just started watching your video for attending interviews...U r amazing sir...no words!!!

Ответить
@Lakshmankablog
@Lakshmankablog - 11.09.2022 08:27

🥳🥳👏🥳👏🙏

Ответить
@ashokyampangu4497
@ashokyampangu4497 - 01.07.2022 06:13

Sir, could you please share the java8 pdf

Ответить
@rahul-java-dev
@rahul-java-dev - 29.06.2022 20:51

Thank you so much Sir.....

Ответить
@ramgavini6031
@ramgavini6031 - 16.04.2022 08:12

Could you please make a session on optional class in jdk 1.8

Ответить
@MahaLakshmi-be3qo
@MahaLakshmi-be3qo - 30.03.2022 10:45

I am able to add hashcode method in interface. I did not get any compilation error interface Testinthash1
{
default void m9()
{
System.out.println(" Inside Test int hash method");
}

default int hashcode()
{
return 10;
}

}

public class HashcodeInJava8 implements Testinthash1
{

public static void main(String[] args)
{

DefaultMethodInJava8 t1 = new DefaultMethodInJava8();
t1.m9();
System.out.println(t1.hashcode());

}
}

Ответить
@SahilYadav-dn9hl
@SahilYadav-dn9hl - 23.03.2022 11:51

sir aap ki jeetani bhi tarif ki jaye kaam sir

Ответить
@sudhakarreddy8731
@sudhakarreddy8731 - 14.03.2022 22:04

new Test().m1(); will also work at duration 1:1

Ответить
@jyoti_kumari0397
@jyoti_kumari0397 - 16.02.2022 20:44

❤️❤️❤️

Ответить
@pmohan7377
@pmohan7377 - 09.01.2022 18:10

I searched no.of websites videos, but I didn't got why they given static and default method. But after watching your video I can give left and right to anyone. Thanks sir

Ответить
@vishwajeetmete
@vishwajeetmete - 06.01.2022 08:12

Can we write multiple default method in interface ?

Ответить
@tusharmarwaha9516
@tusharmarwaha9516 - 16.12.2021 17:31

❤️❤️❤️❤️

Ответить
@akshaynile2778
@akshaynile2778 - 20.10.2021 15:20

But sir,
I know that interfaces are used to provide 100% i.e. absolute abstraction.
but since Java8 interfaces can have concrete methods too.
Now can we still call it 100% abstraction????

If anyone curious about this, please reply.

Ответить
@BoringDeveloper
@BoringDeveloper - 15.10.2021 09:08

Thank You So Much @Durga_Software_Solutions for the playlist of java 1.8v

Ответить
@prasantkumar8602
@prasantkumar8602 - 29.07.2021 13:09

Excellent

Ответить
@puvvadasagar3573
@puvvadasagar3573 - 10.06.2021 20:13

You are awesome sir!! The way you explaining the concepts which i taught was difficult but after watching your videos my opinion changed and it is so clear also helpful and finished 4 sessions and i going to finish all of them soon..

Ответить
@jnanadeepnayak8353
@jnanadeepnayak8353 - 10.06.2021 16:28

Please lizen !! Every Concept is the mowst important concept for Durga Sir.

Ответить
@madhusudhankamalapuram7608
@madhusudhankamalapuram7608 - 06.06.2021 14:27

Your teaching is awesome............. awesome...........

Ответить
@jayantagarwal6339
@jayantagarwal6339 - 19.05.2021 16:07

Thanks, Sir

Ответить
@hemantkumar-cl1yp
@hemantkumar-cl1yp - 06.05.2021 09:47

classes looks bloody classes to Durga sir since java8. :)
Great explanation sir.

Ответить
@shubhamthakur614
@shubhamthakur614 - 24.04.2021 14:37

if you don't like this video and not share with your friends then compiler will give you left and right

Ответить
@SatishKumar-yi8qi
@SatishKumar-yi8qi - 06.03.2021 09:36

suppose a functional interface has abstract method and default method scenario. Does implementation class need to "extend" the FI and then override it or can we achieve thru lambda expression?
Example:
interface interf
{
public void m1 ();
default void m2 (){
System.out.println("default Method");
}
}

public class Main{
public void m2(){
System.out.println("overridden m2");
}
public static void main(String[] args) {
interf f = ()-> System.out.println("m1 method");
f.m1();
f.m2(); - printing the interface SOP not m2 of the Main class hence not getting overridden
}
}

how come we can print m2 method of Main class. if we create object of Main class and print means then there is no use of
having default method in interface.
Can you please explain this concepts

Ответить
@SatishKumar-yi8qi
@SatishKumar-yi8qi - 06.03.2021 09:26

how come comparator is functional interface since it has two methods - compare and equals . If equals methods is overridden in
java.lang.object. then why is the default int hashCode() is not allowed in the Functional interface even it is present in the java.lang.object class. Kindly explain this concepts really confusing.

Ответить
@manibabu
@manibabu - 19.01.2021 09:06

Can u override static methods in interface?

Ответить
@kingcoachingcenter5888
@kingcoachingcenter5888 - 07.01.2021 21:39

Thanks a lot sir...I have watched complete playlist in a day..I am employee to Virtusa..This Playlist saved my Training..

Ответить
@gamechanger750
@gamechanger750 - 30.11.2020 10:43

I am following this channel from last 3 months. Now I am so much confidence in Java Language. Thank you for your valuable tutorial sir.Huge Respect from my side.

Ответить
@anilarkay
@anilarkay - 27.10.2020 19:57

Only person to call a java class as bloody!!
Thats our Durga Sir!!!

Ответить
@mkc0321
@mkc0321 - 15.08.2020 22:17

that last sweeper and IAS officer example is amazing

Ответить
@nandkishorkusalkar9803
@nandkishorkusalkar9803 - 11.08.2020 11:59

Big fan of your teaching sir.
If possible can you please make a video on how to use Lombok feature.
😘

Ответить
@muddu6300
@muddu6300 - 03.05.2020 14:31

I love it .. When u laugh while asking tricky questions 😂😂

Ответить
@phaneendraphani5676
@phaneendraphani5676 - 19.04.2020 15:00

The Good thing is that Durga sir explaining the concepts should be understood by all the members in the team, not only for one. Salute for your patience sir. Some People take money but won't give such an explanation.

Ответить
@ujjawalranjan7579
@ujjawalranjan7579 - 29.02.2020 04:55

Will left.m1(); not work ? Or only left.super.m1() will work when class test implements left, right?

Ответить
@janardhanaraokopusetti6775
@janardhanaraokopusetti6775 - 04.12.2019 16:56

If a class contains all static methods, then no need to create the object to access those methods. However static methods will be loaded into the JVM at the time of compilation only not related to runtime. Then how a class with static methods degrades the performance as compared to interface with static methods ?
In my view while defining utility methods in class as a static methods or in an interface as a static methods does not impact the performance.
Please correct me in case my assumption is wrong. Looking forward for your valuable comment on my assumption.

Ответить
@IndianYakker
@IndianYakker - 30.11.2019 16:21

Awesome,👍

If you require a sweeper then why you go for IAS officer 👌( Static method in Interface )

Ответить
@sanjaysaini5661
@sanjaysaini5661 - 18.11.2019 11:32

very good videos explaining java 8 concepts , by the way can you post one video about java 8 memory structure and demon thread

Ответить
@ahmidahmid9303
@ahmidahmid9303 - 17.11.2019 01:10

thanks

Ответить
@ranjansingh1590
@ranjansingh1590 - 12.10.2019 13:59

Why cant we override default m1() method using a protected modifier in child or implementation class ?

Ответить
@harshparashar9140
@harshparashar9140 - 25.07.2019 06:03

Objects passing to methods is pass by value or pass by reference ?????????

Ответить
@manashmanu
@manashmanu - 11.07.2019 05:43

i want to POSTMORTEM subject like YOU! :)

Ответить