No video

#67 More on Interfaces in Java

  Рет қаралды 80,992

Telusko

Telusko

Күн бұрын

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:
- Implementation of multiple interfaces
- Inheritance in between interfaces
- Method calling of an interface
#1
- We can have a class implementing multiple interfaces.
class B implemets A,X
{
}
(here, A and X are two different interfaces)
- Implementation of all the methods that are present in those interfaces should be given in a class.
- Inheritance is also valid in between interfaces.
- Inheritance can be achieved in between interfaces by using the extend keyword.
- Whenever you create a reference of an interface and create an object of a class, then you can only call those methods by that reference that are present in that interface of which the refernce is created.
- Methods of another interface can be called by using another reference variable for that interface with the object of a class.
#2
*
class - class - extends
class - interface - implements
interface - interface - extends
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

Пікірлер: 19
@grrlgd3835
@grrlgd3835 Жыл бұрын
I started with Navin 3 years ago. I've watched lots of others since aswell but he remains the best.
@masteradvisor594
@masteradvisor594 Жыл бұрын
sir u r perfect always do crisp video upto point. Thank u so much for such amazing playlist.
@psnvenkat2284
@psnvenkat2284 11 ай бұрын
Also there are new features for interfaces in new JDK version, where we can use default method and static method with implementations inside a interface class. FYI
@nguyenquanghau7158
@nguyenquanghau7158 Жыл бұрын
I have an idea for that, we just change type data, for example, we declare that A obj = new B(), and we could you some methods that belong to the A class. But we want to use the run function that belongs to the B class, simply using this command ((B) obj).run(). It will work well.
@suraprashanthreddysura487
@suraprashanthreddysura487 11 ай бұрын
Yes it worked, but don't you think it is written purposely . Like behind it we have a reason?
@psnvenkat2284
@psnvenkat2284 11 ай бұрын
This is call method casting for obj reference. Am i correct?
@merrylia8316
@merrylia8316 10 ай бұрын
is this a one-time use(liek after that command the reference is still A)? or does is change the reference of the obj from A to B?
@merrylia8316
@merrylia8316 10 ай бұрын
great explanation. thank you so much 🤩🤩
@target__iit
@target__iit 5 ай бұрын
(Next Video) Need of Interface in Java -> kzfaq.info/get/bejne/d62PatqIq6jVpYU.htmlsi=Pb8fNRY3lLjxzrL7
@ryansinclaire8463
@ryansinclaire8463 9 ай бұрын
You're saving my life! Thank you!
@batambuzestephen8243
@batambuzestephen8243 6 ай бұрын
I also observed you can extend a normal class and implement an interface within one class
@Trading_Club007
@Trading_Club007 9 ай бұрын
you're saving my money
@vinny4161
@vinny4161 Жыл бұрын
Better to create class B object with reference B so that we can access all methods of interfaces and class B
@TuxTuxedo-oc9kg
@TuxTuxedo-oc9kg Жыл бұрын
I asked myself the question and tried it out since I was not sure what would happen. All of a sudden I love interfaces lol. You can restrict by making the object of either type 1 or 2 (interface 1 or 2) or you can make it access all interfaces by instantiating an object with the type of the implementing class so it gets access to both interfaces since the class implements both. even works if the interfaces methods have the same name, since they have no body you have to implement the method body once yourself. cool stuff!
@merrylia8316
@merrylia8316 10 ай бұрын
​@@TuxTuxedo-oc9kgomg I just realized by reading your comment that I can access the methods in both interface A and X by creating an object of class B with class B as the reference. different approach than what sir navin did in this video.
@jatinsharma3792
@jatinsharma3792 7 ай бұрын
You missed why we use the default private and static method in interface after Java 8 ?
@bhaskarreddy.b2818
@bhaskarreddy.b2818 Жыл бұрын
Sir even class b also should become abstract because the methods we using are abstract in interface class
@uday2159
@uday2159 Жыл бұрын
The B class should be abstract when we not define all abstract methods in it and later we can define remaining methods in sub class of B. Then finally the subclass of B should be non abstract class.
@surya-xy7wc
@surya-xy7wc Жыл бұрын
Sry mapla I'll not interested😜
#68 What is Enum in Java
6:58
Telusko
Рет қаралды 108 М.
#66 Need of Interface in Java
8:32
Telusko
Рет қаралды 125 М.
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 10 МЛН
Кадр сыртындағы қызықтар | Келінжан
00:16
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 7 МЛН
Matching Picture Challenge with Alfredo Larin's family! 👍
00:37
BigSchool
Рет қаралды 47 МЛН
Master Java Interfaces step-by-step
12:49
Jack Hodkinson
Рет қаралды 8 М.
Functional Interface | Lambda Expression in Java
13:56
Telusko
Рет қаралды 146 М.
#52 Method Overriding in Java
7:57
Telusko
Рет қаралды 131 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 933 М.
OOP 5 | Abstract Classes, Interfaces, Annotations
1:10:42
Kunal Kushwaha
Рет қаралды 225 М.
Master Golang with Interfaces
21:54
Kantan Coding
Рет қаралды 11 М.
#51 This and Super Method in Java
12:11
Telusko
Рет қаралды 102 М.
#61 Abstract Keyword in Java
12:09
Telusko
Рет қаралды 143 М.
Fundamental concepts: What's an Interface?
8:44
Source Decoded
Рет қаралды 42 М.
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 10 МЛН