No video

#7.6 Java Tutorial | Default method in Interface

  Рет қаралды 73,498

Telusko

Telusko

Күн бұрын

Instagram : / navinreddyofficial
Linkedin : / navinreddy20
Discord : / discord
More Learning :
Java - bit.ly/3xleOA2
Python :- bit.ly/3H0DYHx
Django :- bit.ly/3awMaD8
Spring Boot :- bit.ly/3aucCgB
Spring Framework :- bit.ly/3GRfxwe
Servlet & JSP :- bit.ly/3mh5CGz
Hibernate Tutorial :- bit.ly/3NWAKah
Rest API | Web Service Tutorial :- bit.ly/38RJCiy
Git :- bit.ly/3NUHB3V
JavaScript :- bit.ly/3mkcFys
Kotlin :- bit.ly/3GR2DOG
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
www.telusko.com...

Пікірлер: 34
@katdareshruti
@katdareshruti 3 жыл бұрын
I think the difference in Abstract class and interfaces is that we do not have to extend all the methods in abstract class while all methods will need to be implemented in interface which is not always what we would want to do.
@stupidteous
@stupidteous Жыл бұрын
nice info
@svenschroder9781
@svenschroder9781 6 жыл бұрын
Your explanations are really great! Thanks a lot for your work.
@conea6891
@conea6891 3 жыл бұрын
Wow, I glad I found this channel.
@mohitsinghrawat503
@mohitsinghrawat503 4 жыл бұрын
Thank you for your explanations. It's clear my doubt how to implement default method but another doubt was created i.e. what is the use of the default method in Interface? why we use it? where its use in the real world?. Thank you in advance
@hariharavelank330
@hariharavelank330 7 күн бұрын
Thanks a lot bro🎉
@MohinPatel
@MohinPatel 6 жыл бұрын
Can you start Tutorial series on how to make extensions for app inventor ?? Please reply !
@maankhurana5814
@maankhurana5814 6 жыл бұрын
Sir one suggestion plz provide all these example code in description of your video
@stephanieezat-panah7750
@stephanieezat-panah7750 Жыл бұрын
excellent video. thank you
@CodingShiksha
@CodingShiksha 6 жыл бұрын
Sir I want to ask you when we have a default constructor already built within java and when we write our custom constructor which one gets precedence and why
@meharban-singh
@meharban-singh 6 жыл бұрын
Coding Geeks Think of self created constructor as an "overridden" constructor, which overrides the default one, so you cannot use default one by any means.
@AmitKumar-fx7kv
@AmitKumar-fx7kv 6 жыл бұрын
Hello sir, as i have tested we can also define methods in interface using static keyword. Can you explain this?
@Mylastpage
@Mylastpage 5 жыл бұрын
you can write default as well as static methods in your interface. Here in your implementation class you can directly use static method with the help of interface name where as you need to use super keyword for the default method. e.g. interface DefaultInterface{ default void method1() { System.out.println("I am Deafult method from DeafultInterface"); } static void method2() { System.out.println("I am static method from DeafultInterface"); } } public class DefaultInterfaceTest implements DefaultInterface { void showUses() { DefaultInterface.method2(); method1(); DefaultInterface.super.method1(); } public void method1() { System.out.println("I am Deafult method from DefaultInterfaceTest"); } public static void main(String[] args) { new DefaultInterfaceTest().showUses(); } } output: I am static method from DeafultInterface I am Deafult method from DefaultInterfaceTest I am Deafult method from DeafultInterface
@aarthijai5927
@aarthijai5927 3 жыл бұрын
Can we have only default method in interface without any public abstract method?.If so ,how to call that default method?
@mdshahim5189
@mdshahim5189 5 жыл бұрын
Sir can't we use lambda expressions for default methods in Interface????? Plz reply 🙏
@user-ns8ht9tu3d
@user-ns8ht9tu3d 5 ай бұрын
As a Career GAP Candidate StartUp Companies Lo Job Ela Techukovaalo Cheppandi Sir (or) Mam🙏🙏🙏?? As a Career GAP(6 years) Student How to to get Java Developer Job in this Year 2024??? Hi, I have a 6 years CAREER GAP. how can I get JAVA DEVELOPER Job in 2024 ??? Two companies(ABC & XYZ) lo job vachindhi fake pettanu & alage 1.5 months 2 Companies lo Work Chesanu, Now i am looking for Job, my doubt is Those 2 companies are creating my pf or Not? further in future is it Effect my carrier? hi, How to get job in PayRoll Companies?? and How to Find PayRoll Companies?
@agt5514
@agt5514 2 жыл бұрын
geiles Video, danke!
@FurryCorner
@FurryCorner 3 жыл бұрын
Does lambda expression only works with abstract methods of functional interface and not with default methods??
@AlexDC93
@AlexDC93 2 жыл бұрын
Yes only the one abstract method will work.
@amitkabi
@amitkabi 5 жыл бұрын
this default method doesn't run in my IDE
@virendrapatel775
@virendrapatel775 6 жыл бұрын
REALLY NEW 👍👌👌
@shawnsaldanha1315
@shawnsaldanha1315 5 жыл бұрын
One doubt!! Imagine we have two interfaces having same method names and it's implementation? Can a class implement these two interfaces? Which interface implementation will the class be inheriting?
@shawnsaldanha1315
@shawnsaldanha1315 5 жыл бұрын
In 1.7, it didn't matter as the implementing Class would overide the method and there was no ambiguity if the method name was same in both interfaces!
@AlexDC93
@AlexDC93 2 жыл бұрын
Just tried it and the result is that you have to override the method in this case. Like an abstract method. Checked exception for "unrelated defaults" occurs otherwise.
@abhilashkokkonda1713
@abhilashkokkonda1713 5 жыл бұрын
Excellent
@real_hello_kitty
@real_hello_kitty 4 жыл бұрын
Thanks😺.
@rahulgoti3864
@rahulgoti3864 6 жыл бұрын
Thank You
@traveltheworld6583
@traveltheworld6583 6 жыл бұрын
Then why can't we use abstract class instead of default ......
@srijalkc1975
@srijalkc1975 5 жыл бұрын
abstract class and default method are different ....u can say "why not abstract class instead of Interface" but not "why not abstract class instead of default method" because default method is a part of Interface...but not whole interface.....i hope this makes sense :)
@mdshahim5189
@mdshahim5189 5 жыл бұрын
@@srijalkc1975 can we use lambda expressions for default methods in Interface???
@digitalnomadg
@digitalnomadg 6 жыл бұрын
could I write more than one default methid in interface?
@Mylastpage
@Mylastpage 5 жыл бұрын
yes
@mdshahim5189
@mdshahim5189 5 жыл бұрын
Yes bro, but only on abstract method!
@IHACKYOU4U
@IHACKYOU4U 6 жыл бұрын
You never give reply to anyone.That's not Good...
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 208 М.
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 86 МЛН
If Barbie came to life! 💝
00:37
Meow-some! Reacts
Рет қаралды 78 МЛН
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 8 МЛН
Abstract Classes and Methods in Java Explained in 7 Minutes
7:00
Coding with John
Рет қаралды 505 М.
Java Interfaces Example & Default Methods
16:02
CodeWithHarry
Рет қаралды 230 М.
Java Interface Tutorial
14:49
Keep On Coding
Рет қаралды 132 М.
Default Methods In Interface JAVA 8 In Hindi
7:39
Engineering Digest
Рет қаралды 19 М.
Java interface 🦅
7:51
Bro Code
Рет қаралды 187 М.
Static vs Non-Static Variables and Methods In Java - Full Simple Tutorial
11:29
Functional Interface | Lambda Expression in Java
13:56
Telusko
Рет қаралды 146 М.
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 86 МЛН