#6.5 Java Tutorial | Dynamic Method Dispatch
In this lecture we are discussing:
1)Loose coupling (Dynamic method dispatch)
2)compile time polymorphism vs runtime polymorphism
3)Benefits of Dynamic method dispatch
#1
loose coupling - using parents type reference and child type object.
Suppose we have three Class A,B and C here B and C are child of A.
in A there are show() method and both class B and c override show() method.
class Main {
public static void main(){
//link this at run time
A obj1 =new B(); //loose coupling
obj1.show(); //this is linking at run time that’s why method overriding is called run time polymorphism
obj1 =new B(); //Dynamic method Dispatch
}
}
class A{
public void show(){System.out.println("this is parent");}
}
class B extends A{
public void show(){System.out.println("This is child B");}
}
class C extends A{
public void show(){System.out.println("this is child c");}
}
Since, during runtime show() method get selected for execution and every time we changing object and therefore method get changed at runtime this is known as dynamic method dispatch.
#2
:-- method overloading is compile time polymorphism, because linking of method get happen during compile time with object.
:-- method overriding is run time polymorphism because linking of method occur during runtime.
#3
benefit of loose coupling:
:--During enterprise level software we are working with loose coupling that time dynamic method dispatch really helpful.
:--Loose coupling allows making changes in the code easily.
:--Testing of loosely coupled structures is easier than the tightly coupled structure.
:--Less amount of code is required to make changes in a loosely coupled structure than in a tightly coupled structure.
Instagram : https://www.instagram.com/navinreddyofficial/
Linkedin : https://in.linkedin.com/in/navinreddy20
Discord : https://discord.gg/aXPF5hV7
More Learning :
Java - https://bit.ly/3xleOA2
Python :- https://bit.ly/3H0DYHx
Django :- https://bit.ly/3awMaD8
Spring Boot :- https://bit.ly/3aucCgB
Spring Framework :- https://bit.ly/3GRfxwe
Servlet & JSP :- https://bit.ly/3mh5CGz
Hibernate Tutorial :- https://bit.ly/3NWAKah
Rest API | Web Service Tutorial :- https://bit.ly/38RJCiy
Git :- https://bit.ly/3NUHB3V
JavaScript :- https://bit.ly/3mkcFys
Kotlin :- https://bit.ly/3GR2DOG
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
http://www.telusko.com/contactus
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «#6.5 Java Tutorial | Dynamic Method Dispatch», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.