Sir, I have a doubt, ie by using interface we need to define (body) the function in the main class and also need to declare interface class & Abstract function, then why should we use that function directly in that main class with out using interface class? because if we using interface our code length is too large...
If you want to enforce any method to use in child class and it should be compulsory then interface/abstract class required with method declaration. If its not mandatory in your all child class then no need of this concept and dont need to extends/implements to any classes.
Interface me jab function ko body define nhi kar skte tho fir iska kya fyda ? Because Hun jaha bhe interface ka function extend krege wha har bar body define krne pdege. Means parent class ke functionality ko tho hun extend nhi kar rhe. Hum tho new code likh rhe hai child class me
hi sir hope you are doing okay. sit whats the benefit of interfaces even they allow us multilevel inheritance but if we see there is no body in the interface class, so instead of just declaring the functions in multiple interfaces and then implementing a class from multiple interfaces, why dont we declare those functions in a single. because the interface just allow us to write the name of the function not the body of a function. so it cannot be used as code re-usability.
i think if we take the previous example of bank and add another class of loan as well we can define all the guidelines regarding banking in the bank interface and other guideline regarding loan in loan interface and then make all the banks (hdfc, icici, idbi) to implement these two interfaces and follow the guidelines according to there way as each bank can have there interest rates and there way to authenticating profile so it depends on them how do they do that but to make them follow the guidelines is where we can use these interfaces..... hope this will help you tried to convey my understanding that's how I understood this topic.
Sir in this video you said interface can only abstract function and second time said all function must be public. It means thoese function have not body that is abstract function
Love From Pakistan To you Sir Best Teacher I ever seen on YOutube Great and thanks for PHP OOP sir
This opps series helps me alot... Thank you for this series
Always welcome Pritesh
conceptual explanation . Helping a lot. Thank you sir
Thank a lot, your videos are beyond the appreciation. Hat's off.
this oops series is awesome help me alot best tutorial for me ... thnx sir
I just love your explanation
Best वीडियो
Excellent explanation....Thanks for sharing the difference between abstraction and interface.
You are welcome Preeti
This really helps me a lot. Thank You so much sir.
I always waiting for your videos!! please implement oops concept like abstraction, traits, interface & static in realtime project.
Sure Arun, Will do that very soon.
Keep working sir
thank you sir ..this series you helped a lot
Thanks💯❤
Good Tutorial Videos
Nice
Thank you sir...
Nice and clear
Thanks a lot.
Sir, I have a doubt, ie by using interface we need to define (body) the function in the main class and also need to declare interface class & Abstract function, then why should we use that function directly in that main class with out using interface class? because if we using interface our code length is too large...
If you want to enforce any method to use in child class and it should be compulsory then interface/abstract class required with method declaration. If its not mandatory in your all child class then no need of this concept and dont need to extends/implements to any classes.
Interface me jab function ko body define nhi kar skte tho fir iska kya fyda ?
Because Hun jaha bhe interface ka function extend krege wha har bar body define krne pdege.
Means parent class ke functionality ko tho hun extend nhi kar rhe. Hum tho new code likh rhe hai child class me
Sir oop base konsa project aayega ?
Ji haan. Per first learn basics
what will happen if there is same function name in both oft the interface
hi sir hope you are doing okay. sit whats the benefit of interfaces even they allow us multilevel inheritance but if we see there is no body in the interface class, so instead of just declaring the functions in multiple interfaces and then implementing a class from multiple interfaces, why dont we declare those functions in a single. because the interface just allow us to write the name of the function not the body of a function. so it cannot be used as code re-usability.
have you found this answer? was thinking the same, why use, it when we have to define every thing again?
@@muhammadsubhanakram5323 not yet
i think if we take the previous example of bank and add another class of loan as well we can define all the guidelines regarding banking in the bank interface and other guideline regarding loan in loan interface and then make all the banks (hdfc, icici, idbi) to implement these two interfaces and follow the guidelines according to there way as each bank can have there interest rates and there way to authenticating profile so it depends on them how do they do that but to make them follow the guidelines is where we can use these interfaces..... hope this will help you tried to convey my understanding that's how I understood this topic.
Sir in this video you said interface can only abstract function and second time said all function must be public. It means thoese function have not body that is abstract function
Right, But that public function is abstract function
Awosem
Thanks a lot Abhishek
well explained but example is not too good😂