I never thought that I will learn java ever but one day my friend told about naveen automation labs and when i saw first video. that day i thought yes I also can learn java..Thanx a lot Naveen.
In java 9 we can create private method under interfaces. And in java 8 default concrete method and static methods are also available. if we are create any default method in interface in that case we must have to use the defect keyword Eg: "default void display() { -- }" Thanks naveen your videos are amazing
Hi, Sir, I absolutely finding these videos very helpful, Where i had no knowledge in Java . I was following the videos serially but got confused after 14 th video. which one should i follow after Interface concept
Naveen, looks like this video has to be modified since from Java 8, Static methods are allowed in interface and there is also a new type called default for method declaration.
Hi Naveen, Thanku for such clarity on every topic. Just a small request, please increase the font while writing the code in eclipse. It is somewhat difficult to get a good view. Thanks a ton.
Hi Naveen, as per the video we cannot create static method in Interface but I have created a static method in interface with method body and second you said, we can't create method body, but we can create method body in Interface. Example for static method is public static void show(){ System.out.println("Static show method");} Example for a method with method body is: public default void debit(){ System.out.println("debit method");}
After jdk 1.8 it's allowed to create static method and default method with body. But with non static and default method, you can't give the method body.
Hi Navin.. I am one of your student .. i Just love your videos and thanks a lot for that.. One small thing i noticed while practicing interface is that only variable declaration (i.e. int minBal; ) is not allowed in interface we have to initialize them (e.g int minBal = 4500). otherwise it gives "Exception in thread "main" java.lang.Error: Unresolved compilation problem: The blank final field minBal may not have been initialized"
Hi Naveen, please make a video on multi threading concept and synchronization in java. Or if there is a video of yours for these topics please share the link.
Very good work sir... One doubt When we cant write static methods in interface why we need static variables(why variable are static by default and what is the use of it)??
In static and non- static video you mentioned like a static variable can be called directly by the variable name or by class name dot variable but in this case why we are not able to call the variable directly even its though its static in nature
I have a doubt if we have same name interface method like debit() this will available in both USbank and Uk bank but those bank have different properties.on that time how can we define method body in testbank class.
Hi Naveen I have a Question here.As you mentioned in the video no static methods are allowed in the Interface.But as per my below code,i am not getting any error.Kindly answer . public interface Con { int a = 10;
Is multiple inheritance possible in java or did you mean multiple level inheritance? what is different between multi-level inheritance and multiple inheritance?
multilevel inheritance can be acheived by inheritance ,.....multiple inheritence can be acheived by interfaces in java.... differnce b/n multilevel and multiple is .... multi-level inheritance : suppose A is the super class ,A has a child named B, and B also have child called C, A(grand father)--->B(father)---> C (child) ---> multilevel inheritence each child has only one parent. multiple-inheritance : Here single child can have more than one parent .....
Can you please make a pictorial memory representation with properly stating the memory names, I am bit confused regarding the memory representation of the following: --USBank b=new HSBCBank()
Hi Naveen, I am a little confused. If we can create an object of any class anywhere as long as the class is public, then why do we need inheritance coz you can only inherit public classes. Please explain this part.
Hai,suppose if they are 10 ten classes with public , you need to create object for 10 classes right ? to acces that class methods, unnecessarily wasting of memory right? if we inherite only one time object creation is enough right? I guess it is correct assumption, if wrong plz correct me.
Hi Naveen, I have a small doubt in calling a static variable in this video. In your earlier video, you said there are two ways to call a static variable 1. Calling directly 2. Calling with ClassName.variable In this time - ua-cam.com/video/ah0pn81IdDU/v-deo.html But here why it not accepting when we call it directly
@@naveenautomationlabs it actually helps in noticing concept and gets finish in half of the time moreover if i neeed to slow i can always pause and rewind.
I never thought that I will learn java ever but one day my friend told about naveen automation labs and when i saw first video. that day i thought yes I also can learn java..Thanx a lot Naveen.
I wonder.. who are these five those put dislike !! Naveen you are really superb. Thank you
i lv your way of teaching so much ,it makes me feel like ..............m apse pdhti rhu pdhti rhu pdhti rhu.............................
In java 9 we can create private method under interfaces.
And in java 8 default concrete method and static methods are also available.
if we are create any default method in interface in that case we must have to use the defect keyword
Eg: "default void display()
{
--
}"
Thanks naveen your videos are amazing
I never understood interface concept so clearly, Thank you Naveen !! Awesome way of explaining.
Naveen, you have explained Interface concept in very simple way. I have learn it now in real sence.Thanks & keep going..... :)
Outstanding Job Mr. Naveen! May God Bless You.
Nice video Naveen. Just one correction Java 8 allows to have static and default methods in interfaces
Really very useful and understood interface Concept and Multiple Inheritance. Thank you once again
Excellent explanation and awesome videos. thanks Mr.Naveen
Hi Naveen, Thank you so much for wonderful videos..
Hi, Sir,
I absolutely finding these videos very helpful, Where i had no knowledge in Java .
I was following the videos serially but got confused after 14 th video. which one should i follow after Interface concept
15th 😂😂
Array vs array list
you are amazing Naveen~!~!thank you very much, helped me a lot. you explained so much easy way to solved all my problems
Thanks for watching Nurjan. Keep learning.
Thank you Naveen. It really helped me
Naveen, looks like this video has to be modified since from Java 8, Static methods are allowed in interface and there is also a new type called default for method declaration.
Hi Naveen, Thanku for such clarity on every topic. Just a small request, please increase the font while writing the code in eclipse. It is somewhat difficult to get a good view. Thanks a ton.
Thanks Naveen!!Ur videos are awesome!!
Very soon we will see 1M subscribe r for Naveen..keep going 🙏🙏
Hi Naveen, as per the video we cannot create static method in Interface but I have created a static method in interface with method body and second you said, we can't create method body, but we can create method body in Interface.
Example for static method is public static void show(){ System.out.println("Static show method");}
Example for a method with method body is: public default void debit(){ System.out.println("debit method");}
After jdk 1.8 it's allowed to create static method and default method with body. But with non static and default method, you can't give the method body.
@@naveenautomationlabs ook
ua-cam.com/video/Lt3T8_utZyw/v-deo.html refer this video
Hi Naveen, As you said We will not able to create main method and static method in interface.But I am able to do it.
Hi Navin.. I am one of your student .. i Just love your videos and thanks a lot for that..
One small thing i noticed while practicing interface is that only variable declaration (i.e. int minBal; ) is not allowed in interface we have to initialize them (e.g int minBal = 4500). otherwise it gives "Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The blank final field minBal may not have been initialized"
Hi Naveen method overriding is run time ploymorphism
Thank you Sir
Hi Sir, as per my understanding inheritance is called is-a relationship and interface is has-a relationship.
nice explanation brother ..easy to understand
Thank a lat sir
Hi Naveen, please make a video on multi threading concept and synchronization in java. Or if there is a video of yours for these topics please share the link.
well explained
Very good work sir...
One doubt When we cant write static methods in interface why we need static variables(why variable are static by default and what is the use of it)??
In static and non- static video you mentioned like a static variable can be called directly by the variable name or by class name dot variable but in this case why we are not able to call the variable directly even its though its static in nature
Thank u naveen
I think there is slight confusion here … Inheritance means Is-A relationship and aggregation means Has-a relationship
Sir what is the significance about minbal variable ? as per minimum balance set by US bank it should be 100. but in child class can alter it to lower
Is there a separate video for multiple inheritance
I have a doubt if we have same name interface method like debit() this will available in both USbank and Uk bank but those bank have different properties.on that time how can we define method body in testbank class.
Hi Naveen
I have a Question here.As you mentioned in the video no static methods are allowed in the Interface.But as per my below code,i am not getting any error.Kindly answer .
public interface Con {
int a = 10;
static void sum() {
System.out.println("hey");
}
}
This is allowed after jdk1.8. You can have static and default methods in interface.
we can define static method in parent interface but we can access that method by using only Interface name.
Is multiple inheritance possible in java or did you mean multiple level inheritance? what is different between multi-level inheritance and multiple inheritance?
multilevel inheritance can be acheived by inheritance ,.....multiple inheritence can be acheived by interfaces in java....
differnce b/n multilevel and multiple is ....
multi-level inheritance : suppose A is the super class ,A has a child named B, and B also have child called C,
A(grand father)--->B(father)---> C (child) ---> multilevel inheritence each child has only one parent.
multiple-inheritance : Here single child can have more than one parent .....
Can you please make a pictorial memory representation with properly stating the memory names, I am bit confused regarding the memory representation of the following:
--USBank b=new HSBCBank()
Naveen please put this code link in Description
So that easy to download
Thank you
Hi Naveen, I am a little confused. If we can create an object of any class anywhere as long as the class is public, then why do we need inheritance coz you can only inherit public classes. Please explain this part.
Hai,suppose if they are 10 ten classes with public , you need to create object for 10 classes right ? to acces that class methods, unnecessarily wasting of memory right? if we inherite only one time object creation is enough right?
I guess it is correct assumption, if wrong plz correct me.
hi naveen what to do when two interface have same methods and same signature the test class calls which method????
Child class will implement only one method and test class will call that method.
@@naveenautomationlabs so which method will be implemented interface 1 or interface2??
oh understood @Naveen AutomationLabs i just implemented it practically
What if, if both the interface has same method then which method would get implemented
Just one small doubt.. Can 2 different Interface have same method .
If yes, how can we call them in single class.
you can have same methods in 2 diff interfaces. But you need to override only once in child class and write buss logic accordingly.
@@naveenautomationlabs Thank you so much... Your videos are really really helpful.
java 8 allows static methods in interface
make video of abstract class also
If static methods not allowed in Interface then how come variables are allowed?
Hi Naveen,
I have a small doubt in calling a static variable in this video.
In your earlier video, you said there are two ways to call a static variable
1. Calling directly
2. Calling with ClassName.variable
In this time -
ua-cam.com/video/ah0pn81IdDU/v-deo.html
But here why it not accepting when we call it directly
because min_bal is not part of same class. U can call direcly when variable is part of same class.
i always watch your videos at 1.5 speed rate
Why?
@@naveenautomationlabs it actually helps in noticing concept and gets finish in half of the time
moreover if i neeed to slow i can always pause and rewind.
yes thats best way to revise. he has crystal clear explanation, no redudent talk
What if two interfaces we are implementing have same methods.
sir mutualfund s.o.p statement is not printing
You should create object in TestBank.
BrazilBank bb = new HSBCBank();
Then try bb. U will get mutual fund()
I have one doubt, what happen if us bank and uk bank have same method name
For ex: credit method of uk bank
Credit method of us Bank
It docent matter. because normally you create object from interface call the method. you can call what ever the method you want.
How the mutual fund run in main method?
can we declare the same method for different Interface?
but I am able to create main method inside an interface