8.21 Interface in Java Tutorial with Example

  Рет қаралды 268,177

Telusko

Telusko

Күн бұрын

Пікірлер: 86
@RemiStardust
@RemiStardust 7 жыл бұрын
I learned something I had not understood before! This was a good use of my time, thank you very much!
@nadipriya1579
@nadipriya1579 3 жыл бұрын
Pòoo
@jyothikrishna2588
@jyothikrishna2588 2 жыл бұрын
I was understanding this concept through some of the articles but I just could by heart it really couldn’t understand. When I saw this I got the concept in the first 4 minutes itself. U r the best java teacher ever. Thanks a bunch
@kspavankrishna
@kspavankrishna 6 жыл бұрын
3:57 it's not xyz it's Pqr Am I right ?
@palashshanu
@palashshanu 4 жыл бұрын
yes
@teamehailu5931
@teamehailu5931 2 жыл бұрын
The way you explain the concept is so amazing. I love it.
@nadipallisaikrishna6510
@nadipallisaikrishna6510 2 жыл бұрын
Implementation of functional interface nice explained,thank you very much sir,just stand out of box
@krishnasalampuriya1311
@krishnasalampuriya1311 6 жыл бұрын
I was finding this from long time , finally got that from you , very very thanks....
@ProfesorBruno
@ProfesorBruno 5 жыл бұрын
Great explanation. Thank you so much! You're an outstanding tutor. Well structured video, concise and informative, as usual.
@mayureshwarkhurud3208
@mayureshwarkhurud3208 5 жыл бұрын
Your videos are just outstanding....we get to know new concepts in very less time as compared to other videos
@TheFlyguy31
@TheFlyguy31 8 жыл бұрын
i like the way you explain these examples, it is very creative..
@gauravmandwariya333
@gauravmandwariya333 4 жыл бұрын
bhot heavy jaa raha h sir ab to after 90 video
@madhavanrao3626
@madhavanrao3626 4 жыл бұрын
You are just awesome sir👏👏👏
@srinuchallagundla6412
@srinuchallagundla6412 6 жыл бұрын
Thanks for your great tutorials
@jojomojo1677
@jojomojo1677 6 жыл бұрын
sir thank you very much !!! You are best teacher!!!
@Er_IT_prashantjha
@Er_IT_prashantjha 2 жыл бұрын
Kal interview hai 😂😂 Bing watching your lectures 😂😂😂
@ralphmichael3355
@ralphmichael3355 8 жыл бұрын
Loved it! Simply great :)
@sapnavats9105
@sapnavats9105 6 жыл бұрын
As you said in your earlier video on interface that we cannot create an object of interface so out here while using anonymous inner class why are you creating on object of the interface Abc?
@dhanush2715
@dhanush2715 6 жыл бұрын
@@zanspehonja4467 No What u said finally doesn't works
@dhanush2715
@dhanush2715 6 жыл бұрын
The reason why we cannot create an object for an interface is that, there is no implementation for an interface class... Hence we cannot create object.... But what if we do that implementation so that we are able to create an object.. That's what he does in the inner anonymous class=implementation.. That's it...
@cyber_dbs
@cyber_dbs 2 жыл бұрын
does the annonymous class you have created implements Abc? you missed to explain that...
@A2DChannel
@A2DChannel 7 жыл бұрын
Everyone? hv i heard everyone?? where's alien?
@rareangel15
@rareangel15 4 жыл бұрын
You cannot create object for Abc right because it's interface but how you create?
@RiteshKumar-ri1xq
@RiteshKumar-ri1xq 6 жыл бұрын
Excellent explanation.
@souparnamukhopadhyay5210
@souparnamukhopadhyay5210 4 жыл бұрын
lec(8.21) - interface example the method show() should be public in the class 'abcimpl' at the time of defining the method. why it is so? please explain
@saurabhmahurkar5890
@saurabhmahurkar5890 3 жыл бұрын
If the method is not public then how can we create object of that method's class in another class, that's why it is made public!
@Alldata123
@Alldata123 3 жыл бұрын
Good good good explanation
@avinashjadhav9265
@avinashjadhav9265 Жыл бұрын
Current year is 2023 and i understand what is interface by his video
@genprimabiocakti6159
@genprimabiocakti6159 4 жыл бұрын
SO lamda expression ()-> is using for interface that have only ONE abstract method. to implement method the class who impl interface, we can using static method. CMIIW
@vladanulardzic5859
@vladanulardzic5859 5 жыл бұрын
Well done ! Keep on ...
@studyaddicts2772
@studyaddicts2772 4 жыл бұрын
Love you Sushant
@xtempo9913
@xtempo9913 4 жыл бұрын
Sir why we have to make void show 'public' in AbcImpl class ?
@skillkrio
@skillkrio 2 жыл бұрын
Hi Marek, I read you java tight and loose coupling article. I had certain doubts in loose coupling watched several youtube video and article but still couldn't grasp certain points. I will explain what i understood and what confuses me . In loose coupling we restrict the direct coupling between classes. But in tight coupling we are bound to classes. Let's take an example. I have one Main class and another different class with the name Apple. I am creating instance of any of this class in Main class by Apple apple =new Apple(); //Apple is tightly coupled to Main class apple.eat(); //If eat method signature is Changed to drink in the Apple class ofcourse we need to change the method name here also right?. Let's see loose class interface Fruits{ void drink(); } Class Apple implements Fruits { @Override public void drink (){ Printing some message; } } class Main{ public static void main(String [] args){ Fruits apple = new Apple (); //loose coupled ?? apple.drink(); } } If i Change the method signature in loose coupling from drink to pour . I need to change the code in 3 different places. 1. method signature inside Fruits interface(drink to pour) 2.class Apple(method override from drink to pour) 3.inside Main class(method call from apple.drink to apple.pour) What's the point of using loose coupling here. In tight coupling once I modify the coupled class(Apple) i am forced to update the Main class. In loose coupling also I am doing the same process .what's the point of using it. The only benefit that I can feel through loose coupling is the interface reference type .for example Tight coupling code Main class{ //boiler plate code Apple apple = new Apple(); } In future if i create Mango class i need to create another object in Main class like Mango mango = new Mango(); Loose coupling code Main class{ //boiler plate code Fruits apple =new Apple(): //In future if i Change Apple() to Mango() no error will occur here because of the reference type(Fruits). } Please help me to understand with this analogy
@user-mo3bk6wv6l
@user-mo3bk6wv6l 7 жыл бұрын
how are u recording this at 7:10am?????? i can barely spell my name that time
@payambassi8784
@payambassi8784 3 жыл бұрын
Tiny mistake i think at 4:01 ,it should be "implements Abc , Pqr" not "Abc, xyz"
@jeffszurgot
@jeffszurgot 4 жыл бұрын
Ok I understand nie how IT od create, but still don't know why ( what for)? What od the purpouse od interfaces
@tanmaysharma5684
@tanmaysharma5684 8 жыл бұрын
when there are more than 1 method in interface then how to use lambda expression
@PramodSubramanyam10
@PramodSubramanyam10 7 жыл бұрын
U cant use Lambda expression when u have more than 1 method in interface..Suppose if u want to use lambda then for each method u need to create an interface.. public interface Inter { public void show(); } public interface Inter3 { public void display(); } public class Inter1 { public static void main(String[] args) { Inter obj = () -> System.out.println("hello show"); Inter3 obj1 = () -> System.out.println("hello display"); obj.show(); obj1.display(); } }
@dhanush2715
@dhanush2715 6 жыл бұрын
If there are more than one method in a single interface, u must use curly braces right after the arrow mark, as shown in the video
@rotorfpv4117
@rotorfpv4117 8 жыл бұрын
what is the point with the interfaces ? I cant see functionality of this one. The Interface is created to inform me about some name of methods which I must to use and implement. And where is the sense? I use some classes with my method regardless, if I implements interface or not.
@PramodSubramanyam10
@PramodSubramanyam10 7 жыл бұрын
Interface provides security as told by Navin sir in previous video If u want to inherit hundreds of classes into 1 class, then it can be easily done by interface....
@saurabhmahurkar5890
@saurabhmahurkar5890 3 жыл бұрын
heard of abstraction? It is used for that purpose!
@philipT8989
@philipT8989 4 жыл бұрын
why cant u just implement Abc in the class Telusko?
@shaktimanvlogs7294
@shaktimanvlogs7294 6 жыл бұрын
sir can u tell me the question which will ask durin interview on interface?
@fazchow4679
@fazchow4679 8 жыл бұрын
Can you make a tutorial series on Scala Programming? Your tutorials are really helpful. Thank you for your effort. You make learning really easy and accessible.
@Chirag_vaghela01
@Chirag_vaghela01 2 жыл бұрын
sir can we run this in the notepad also !?
@hemantjadhav1128
@hemantjadhav1128 7 жыл бұрын
hello sir....nice video
@akshaygulati2041
@akshaygulati2041 8 жыл бұрын
+Telusko learnings...can u suggest something abt this error...
@gargisingh1528
@gargisingh1528 4 жыл бұрын
my interface code is not executing sir please recommend something
@saurabhmahurkar5890
@saurabhmahurkar5890 3 жыл бұрын
Can you elaborate the problem faced?
@tamim2996
@tamim2996 8 жыл бұрын
Hello Sir, I have 1 question...ur saying interface is use to do multiple inheritance. But my question is in inheritance the method is already implemented we inherit the class and just reuse the method instead of rewrite it again....but in interface the child class has to implement the method...so where is the benefit of using interface if i have to implement the mhod in child class... The way you teach java its just amazing. Thanks a lot.
@syedabbashashim6763
@syedabbashashim6763 8 жыл бұрын
bro As interfaces are abstract therefore we cannot define a method directly inside it infect we need a class to do this task therefore using this technique we can declare multiple abstract functions inside multiple Interfaces in order to perform multiple inheritance because Mutiple interfaces can be implement with one class but not multiple classes can inherit each other.Therefore Interfaces is an alternate way to do multiple inheritance in java using classes.
@shubhamsingh-nt9mm
@shubhamsingh-nt9mm 6 жыл бұрын
u r doing a great job,one suggestion if u can upload all the tutorial program that u have used in the video on github
@ganga1
@ganga1 4 жыл бұрын
But obj is an reference, we didn't have any object... without NEW keyword will it work
@lilrana
@lilrana 7 жыл бұрын
Sir can it possible that interface class method can define differently where different classes implements it.
@Deepusingh-ct6kx
@Deepusingh-ct6kx Жыл бұрын
Yes
@mokasafatamirbehesti5657
@mokasafatamirbehesti5657 2 жыл бұрын
Got it. ❤️
@anikettambe8147
@anikettambe8147 7 жыл бұрын
Sir can we have variable in Interface
@ankushtyagi729
@ankushtyagi729 7 жыл бұрын
yes but only public
@Devilnero1991
@Devilnero1991 5 жыл бұрын
But why use an interface? If I delete the interface all that does is shorten my code, which is good! so whats the use of an interface?
@divyeshkumarbalar7732
@divyeshkumarbalar7732 5 жыл бұрын
I was trying to put variable in interface; but, i cant just declare it; i have to define it as well
@divyeshkumarbalar7732
@divyeshkumarbalar7732 5 жыл бұрын
and that variable behave as final by default
@Jai_Raj_007
@Jai_Raj_007 6 жыл бұрын
Fantastic
@akshaygulati2041
@akshaygulati2041 8 жыл бұрын
class A{ int i=5; } interface B{ int i=6; } class C extends A implements B{ public void show() { System.out.println(i); } } class main{ psvm(String...a){ new C().show(); }} this program shows ambiguos error. Can any1 explain it??
@akshaykumarsingh3637
@akshaykumarsingh3637 8 жыл бұрын
chenge the class name then exucute
@RahulKumar-pd2cm
@RahulKumar-pd2cm 7 жыл бұрын
use either A.i or B.i instead of i , this will remove ambiguity during calling
@RahulKumar-pd2cm
@RahulKumar-pd2cm 7 жыл бұрын
System.out.println(A.i); or System.out.println(B.i);
@Arunganesan1
@Arunganesan1 6 жыл бұрын
Many thanks for asking this question.This is what I want to know?....
@bass9454
@bass9454 8 жыл бұрын
very good vids
@khanmusarratbegum4917
@khanmusarratbegum4917 3 жыл бұрын
Not getting abstract and interface its confusing
@anant8884
@anant8884 3 жыл бұрын
Suggestion : Please use better variable names. These types of name needlessly increase complexity.
@dhanushsivajaya1356
@dhanushsivajaya1356 4 жыл бұрын
Thankyou sir
@mohammedviso2269
@mohammedviso2269 8 жыл бұрын
Thank you
@cakfarm7816
@cakfarm7816 8 жыл бұрын
Subscribing.
@venkatmaddirala5568
@venkatmaddirala5568 6 жыл бұрын
@telusko , please upload videos on java io
@BabuBabu-nn5fv
@BabuBabu-nn5fv 5 жыл бұрын
👌
@mysticstardust1109
@mysticstardust1109 5 жыл бұрын
still quite confuse...
@BabuBabu-nn5fv
@BabuBabu-nn5fv 5 жыл бұрын
Woo
@ajaygalagali5963
@ajaygalagali5963 4 жыл бұрын
:)
@bass9454
@bass9454 8 жыл бұрын
are you jesus?
@shubhammaurya3671
@shubhammaurya3671 3 жыл бұрын
confusing tutorial
#65 What is Interface in Java
8:03
Telusko
Рет қаралды 260 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Functional Interface | Lambda Expression in Java
13:56
Telusko
Рет қаралды 165 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 573 М.
Java Interfaces Tutorial
15:42
Programming with Mosh
Рет қаралды 77 М.
Multithreading in Java Explained in 10 Minutes
10:01
Coding with John
Рет қаралды 993 М.
8.18 Abstract Class in Java Example
15:27
Telusko
Рет қаралды 384 М.
#66 Need of Interface in Java
8:32
Telusko
Рет қаралды 162 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 993 М.
Abstract Classes and Methods in Java Explained in 7 Minutes
7:00
Coding with John
Рет қаралды 570 М.
Java ExecutorService - Part 1 - Introduction
10:12
Defog Tech
Рет қаралды 427 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН