Тёмный
No video :(

#66 Need of Interface in Java 

Telusko
Подписаться 2,4 млн
Просмотров 128 тыс.
50% 1

Check out our courses:
Enterprise Java Spring Microservices: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-sp...
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
Java For Programmers:- bit.ly/javaPro...
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusk...
In this lecture we will learn:
- Methods in java
- What is an interface?
- Need for an interface
#1
- We can also pass an object as a parameter in a method.
- When you build an application, you need to make it more flexible.
- We can create a reference of the parent class and an object of the sub-class.
- Passing reference and the reference of an object that you accept in a method, both should be the same.
#2
Interface:-
- Interface in Java is used to achieve abstraction.
- Interface is used to design an application to make it loosely coupled.
- implements keyword is used with a class to extend it to an interface
interface Computer
{
}
.........
class Desktop implements Computer
{
statement;
}
#3
Need of an Interface:-
- It is used to implement abstraction.
- We can also achieve multiple inheritance in Java, by using the interface.
- Any class can extend only 1 class but can any class implement an infinite number of interface.
- It is also used to achieve loose coupling.
Github repo : github.com/nav...
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Опубликовано:

 

4 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@leonardorafaelli8026
@leonardorafaelli8026 4 месяца назад
What an awesome tutorial! You showed the problem and then showed how to solve it, simple and direct. Perfect, thank you very much!
@amanjain5045
@amanjain5045 Месяц назад
I really do not know how to thank you! The real life example you show, and the way you show it step by step. The reason I am now good at Programming is not because of my University, it is you!
@SP-vq7tg
@SP-vq7tg 3 месяца назад
Simply Woow!! Its crisp and clear.. I spent 17k on Java course and ended up confused. Wish i had found you before...
@SATHWIK05
@SATHWIK05 10 месяцев назад
Good explanation sir Understood everything....
@sarthakavaiya3360
@sarthakavaiya3360 8 дней назад
great way of explaining interface
@sastisfya2721
@sastisfya2721 Год назад
Congratulations boys and girls for more than 60%completion !!!! Just a few more to goooo!! Les ghoooo💪
@TreatsNTravelsByJaaiPawar
@TreatsNTravelsByJaaiPawar 11 месяцев назад
Hi 5 .. just completed this video!
@merrylia8316
@merrylia8316 10 месяцев назад
🤗
@painisgain1003
@painisgain1003 Месяц назад
Thank you so much, I've been looking for a good explanation of interfaces :)
@sher.5027
@sher.5027 7 месяцев назад
Bhai, you are the best teacher who teaches with the best and simplest examples.
@amsha3083
@amsha3083 Год назад
Extremely Ambiguous
@Sanjay-xq5xr
@Sanjay-xq5xr 2 месяца назад
Awesome explanation with example.
@i_dhiraj
@i_dhiraj 2 месяца назад
u are awesome sir u teaching very fine respect !
@MohdKhan02
@MohdKhan02 5 месяцев назад
whats the basic difference between using interfaces and implemenths rather using abstract class with our regular inheritance extends keyowrd? can anyone plz explain me?
@arsh3250
@arsh3250 Месяц назад
Well, the interface has a lot of specific features. Like here we are allowed to perform multiple inheritance i.e a class can implement more than one interfere, no the case when we are using abstract classes. Also, we need to keep in mind that abstract classes are not solely for designing, I mean we can have concrete methods in it as well right? But you know interfaces are purely for design purpose, the methods in it are by default abstract and public.
@andrewjenson_original
@andrewjenson_original 5 месяцев назад
Hi, I'm confused. It seemed like your video showed the value of an abstract class Computer. But, then, in the last 10 seconds of this video, you changed Computer from an abstract class to an Interface. But, I'm not sure what the value is for changing it to be an interface? It seems like the real value was gained by having Computer be an abstract class.
@srikardevarakonda2933
@srikardevarakonda2933 3 месяца назад
Exactly.. same doubt.. this is a video on abstract class, not interface.
@user-ct8yf3wd2g
@user-ct8yf3wd2g 11 месяцев назад
I tried this and it works fine but there is a flaw. if the variable type is Computer then I cannot use the property and method of the children class as the compiler at the moment we compile the code only know the members of the Computer class. But it works if we just want to reuse the code function with different implementations. Great video by the way sir
@user-nq4ho4hp5v
@user-nq4ho4hp5v 10 месяцев назад
What you tried now (And what's in the video), is called "Upcasting". Maybe you can explore more about "Upcasting" and "Downcasting" in Java.
@JavaMoth
@JavaMoth Год назад
Yep, it's clearer now
@abhishekkale8750
@abhishekkale8750 5 месяцев назад
what a great explanation. thank you Naveen sir
@HabiburRahman-dm5yt
@HabiburRahman-dm5yt 4 месяца назад
Your teaching is well. but here I have a question. You have showed loose coupling using inheritance, abstraction and interface. All are working well. But when can we choose the suitable one?
@sridharmurari3007
@sridharmurari3007 10 месяцев назад
One question when we need to go for Abstract vs Interface
@user-wk9vo1we4v
@user-wk9vo1we4v 2 месяца назад
Whenever you want partial abstraction use abstract class and for full abstraction use interfaces
@kns436
@kns436 3 месяца назад
Ur old video on this is far better
@kamakshijayaraman3747
@kamakshijayaraman3747 Месяц назад
you just showed what an interface can do with abstract class. what is the difference? why we need interface
@davidhusted817
@davidhusted817 6 месяцев назад
What about if we make a method code as abstract and use anonymous class , because the best practise to avoid instantiate classes further we need it because that make memory leak
@aszaw5342
@aszaw5342 Год назад
Great explanation!
@madhukarverma5634
@madhukarverma5634 2 месяца назад
Too good sir
@vipassassin404
@vipassassin404 6 месяцев назад
When I try to keep a method which is not a public in the class which implemented from an interface,why it is showing error...
@linquanma6145
@linquanma6145 Год назад
Very nice example
@user-uk1dx2nc1l
@user-uk1dx2nc1l Год назад
great bro
@sahilthegeek
@sahilthegeek Год назад
amazing tutorial😀😀😀
@likithmc3435
@likithmc3435 6 месяцев назад
Desktop ❌ Dekstop ✅
@YouTube.com33
@YouTube.com33 11 месяцев назад
I Can Understand Sir😍
@ALIHAMZAAKRAM-oe2su
@ALIHAMZAAKRAM-oe2su Год назад
hy ,sir in the #65 video you should modify your example as the comapny can give a developer a laptop or desktop rather than a devolper need a laptop due the wrong example i have to see the videoo again to understand the concept
@shraddhapawar5674
@shraddhapawar5674 Год назад
Best teacher
@pst659
@pst659 3 месяца назад
stil you didn't explain why we need interfaces. you only explain why we need abstract classes
@ALENBELJI
@ALENBELJI 10 месяцев назад
When we create a reference to the parent and object of child we can only access the methods of the parent but how did you code was able to acccess the methods of the child
@SATHWIK05
@SATHWIK05 10 месяцев назад
Same doubt
@001vidhu
@001vidhu 8 месяцев назад
Its the object of child class & its not upcasted. thats why .
@davidhusted817
@davidhusted817 6 месяцев назад
This is the downCasting
@thanveerpp1983
@thanveerpp1983 4 месяца назад
@@davidhusted817how this is down casting This is upcasting ,because the object of child class has been assailed to parant class object variable
@ROSHAN-HARI-BALAJE
@ROSHAN-HARI-BALAJE 3 месяца назад
0:40 Humans? but... but we are aliens!!!!
@yuv09
@yuv09 Год назад
Your provided source code is self explanatory.... Code + video = Java dead 💀
@aryadeep099
@aryadeep099 8 месяцев назад
0:40 I beg to differ, sir. Corporates prefer the term "slave" 😭
@danielderese3170
@danielderese3170 Месяц назад
TTTHHHHAAAAKKK YYYOOOUUU!
@majorgabREAL
@majorgabREAL 10 месяцев назад
What is the main difference between abstract and interaface? Besides the fact that interface is not a class, how to know when to use which ?
@madhusudhanreddychencharap4881
@madhusudhanreddychencharap4881 10 месяцев назад
In abstract class there is a chance to add concrete methods but on other hand interface is 100 % abstraction no concrete methods allowed
@sourabh515
@sourabh515 Год назад
very confusing for newbies
@GOKULK-ll8ur
@GOKULK-ll8ur Год назад
i thought we were aliens
@vishwasrchonu7134
@vishwasrchonu7134 4 месяца назад
Bro, you are pretty awesome, but by what logic are you saying desktops are always faster than laptops? 😂😂😂😂
@vishwasrchonu7134
@vishwasrchonu7134 4 месяца назад
Of course, you're a human, but let's just say you're a developer 😂😂😂😂😂😂
@bellsvlog2064
@bellsvlog2064 Год назад
just waw
@amroulouay6819
@amroulouay6819 Год назад
Dekstop😂 3:28
@Decoding108
@Decoding108 Год назад
Why u make everything so hard to understand , don't use your 10 years of experience in explaining lit things
Далее
#67 More on Interfaces in Java
3:22
Просмотров 82 тыс.
#65 What is Interface in Java
8:03
Просмотров 196 тыс.
3d printed demon core vs real
00:24
Просмотров 6 млн
#40 Encapsulation in Java
11:42
Просмотров 169 тыс.
#61 Abstract Keyword in Java
12:09
Просмотров 146 тыс.
Difference between Interface and Absract Class
16:57
Просмотров 964 тыс.
#68 What is Enum in Java
6:58
Просмотров 110 тыс.
Master Golang with Interfaces
21:54
Просмотров 12 тыс.
A Practical Example How To Use Interfaces In Golang
14:42