Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Java - Day 65 (in Telugu) - A parent class reference can refer any of it's child class object

  • PoornaChandra Karyampudi (ComPro)
  • 2022-12-28
  • 178
Java - Day 65 (in Telugu) - A parent class reference can refer any of it's child class object
programexplainexplanationpoornapoornachandracomprouppalhyderabadc languagec-languagec++javacppdata structuresweb technologiesclass roomwhite boarddetaildetailedline by linehtmlcssjavascriptlivescreen capture
  • ok logo

Скачать Java - Day 65 (in Telugu) - A parent class reference can refer any of it's child class object бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Java - Day 65 (in Telugu) - A parent class reference can refer any of it's child class object или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Java - Day 65 (in Telugu) - A parent class reference can refer any of it's child class object бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Java - Day 65 (in Telugu) - A parent class reference can refer any of it's child class object

/* Dynamic Binding: A parent class reference can refer any of it's child class objects and invoke child’s methods
*/
class Fruit{
void color(){ System.out.println("color not known"); }
void size(){ System.out.println("size not known"); }
void isGood(){ System.out.println("good for health"); }
void taste() { System.out.println("sweety"); }
}
class Mango extends Fruit{
void color(){ System.out.println("\nMango color is Yellow"); }
void size(){ System.out.println("Mango size is medium"); }
void culti() {System.out.println("Mango is cultivated in many parts of India and other countries"); }
}
class WaterMelon extends Fruit{
void color(){ System.out.println("\nWaterMelon color is Red"); }
void size(){ System.out.println("WaterMelon size is big"); }
void culti(){} {System.out.println("Mango is cultivated India only"); }
}
class Grape extends Fruit{
void color(){ System.out.println("\nGrape color is Green/Black"); }
void size(){ System.out.println("Grape size is small"); }
void taste() { System.out.println("Grape is sour"); }
}
class Orange extends Fruit{
void color(){ System.out.println("\nOrange color is Orange"); }
void size(){ System.out.println("Orange size is medium"); }
void taste() { System.out.println("Orange is bitter"); }
}
class ObjectPass1{
public static void main(String arg[]){
Mango m = new Mango();
WaterMelon w = new WaterMelon();
Grape g = new Grape();
Orange o = new Orange();
fun(m);
fun(w);
fun(g);
fun(o);

m.color();
m.size();
m.isGood();
m.taste();
m.culti();
}
static void fun(Fruit f){
f.color();
f.size();
f.isGood();
f.taste();
//f.culti();
}
}

/*
A parent class reference can refer any of it's child class object.
In that case, the parent reference can invoke the method of child.
Condition is the method should be available in the parent class also.
If the method is not available in the child, then the parent method is executed.
If the method is available in the child, then the child method is executed.
If the method is not available in the parent, the invocation FAILS.


two points
1) is the statement valid or not?
if the method is available in the class of reference variable.
(color) (Fruit) f
(culti) (Fruit) f
(culti) (Mango) m

2) which version of the method is invoked?
method of the class to which the reference is referring
(color) (Mango) (f)
*/

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]