Тёмный

Java Programming Tutorial - 31 - Inheritance, Abstract Classes and Abstract Methods 

A J
Подписаться 3,1 тыс.
Просмотров 21 тыс.
50% 1

Video describing inheritance in Java, using abstract classes, concrete classes and abstract methods.

Наука

Опубликовано:

 

28 июл 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@UniProgrammer
@UniProgrammer 6 лет назад
public class Main { public static void main(String[] args) { Dog myDog = new Dog("Spike", 2); Cat myCat = new Cat("Fluffy", 3); myDog.speak(); myCat.speak(); } } public abstract class Pet { protected String name; protected int age; public Pet(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public abstract void speak(); } public class Dog extends Pet { public Dog(String name, int age, boolean hasLicense) { super(name, age, hasLicense); } @Override public void speak() { System.out.println(this.name + " said bark bark!"); } } public class Cat extends Pet { public Cat(String name, int age, boolean hasLicense) { super(name, age, hasLicense); } @Override public void speak() { System.out.println(this.name + " said meowww!"); } }
@musawenkosintombela3797
@musawenkosintombela3797 3 года назад
Thank you very much
@QFGEE
@QFGEE Год назад
University of the People sent me here, and this is a far better explanation than the one they gave.
@monojitchakraborty1259
@monojitchakraborty1259 Год назад
This is gold! all my doubts about inheritance and abstract class are solved after watching this.
@dorukgencel3997
@dorukgencel3997 Год назад
Thanks mate, solved an issue I was having. Just didn't notice the problem, following correct steps made me realize how stupid the mistake was :)
@nelisiwecynthia5390
@nelisiwecynthia5390 5 лет назад
Hi, thank you so much. I am preparing for my OCA Exam and watching this video really helped. Keep up doing what you do best
@UniProgrammer
@UniProgrammer 5 лет назад
Thank You!
@jamesacheneider
@jamesacheneider 3 года назад
Thank you bro, you explain things clearly and at a good pace, I was following derek banas tutos but the guy explain things like he is in a race, even though he is good.
@jamesmonto9562
@jamesmonto9562 3 года назад
Thank you. I’m worshiping the wall as we speak. A mistake I made was not using “this.*property=property” in a program I was making. I was stuck for a good 4 hours. (Could’ve been more effective but didn’t really care.) Thank you. Fixed my problem.
@vaibhavwaghole8753
@vaibhavwaghole8753 3 года назад
Hey Andru, Thanks Alot...My concept are cleared in very easy manner through your video. Will definately refer your videos and channel as well. Stay blessed. Love From India🇮🇳
@karentechnologies3990
@karentechnologies3990 3 года назад
very professional and informative video keep it up
@ratimshariar102
@ratimshariar102 2 года назад
I am clear now thank you soo much man
@jibinjames5128
@jibinjames5128 2 года назад
Good One
@MaruBaku
@MaruBaku 2 года назад
Thank you for this video, it will help me with my assignment!!!
@naveedasgari8415
@naveedasgari8415 3 года назад
Really helpful, thanks a lot brother
@nyanpie7296
@nyanpie7296 3 года назад
Hello! I was wondering if an accessor method can be an abstract method, because I'm making an abstract Coin class and the super classes under it has different values (for example the value of toonie is 2.0)
@dedz
@dedz 2 года назад
One question that I have is why to use abstract methods when we already know that we are going to need to make a method in the instance and probably already knows what the method should do? I mean, for me, it makes more sense to make a non-static method speak() inside the Pet abstract class and make it generic for all the subclasses (name and age for parameters so when you call the speak method you just need to pass the name and age as arguments), and if you want to change the speak method inside a subclass, you just override in that subclass.
@shxkxth8135
@shxkxth8135 2 года назад
thank you so much for this video
@shephardstudio7617
@shephardstudio7617 2 года назад
Good day Man. I really love your videos, just a quick question. Can a method be accessed from a subclass of an inherited class that is (This method should be different from the method of it's superclass)
@ninaalexieva6443
@ninaalexieva6443 3 года назад
Hi Andrew, Are you still making Java tutorials? I would like to ask you many questions about it, as I find your way of teaching very helpful to me. But I see you didn't add since 2018. Now we are 2021....How can I contact you? Nina
@mehndiart931
@mehndiart931 2 года назад
define abstract class Hospital with protected member id and name define a parameterized constructor. define a sub class Doctor with member department. Create n objects of Doctor and display all details. I want ans of this question
@FreakStorm21
@FreakStorm21 2 года назад
LOL, we're at 6969 views
@joy-sm5sl
@joy-sm5sl 2 года назад
damn fwuffy can't make me focus
Далее
Java Programming Tutorial - 32 - Composition
8:38
Просмотров 20 тыс.
ШАР СКВОЗЬ БУТЫЛКУ (СКЕРЕТ)
00:46
1❤️
00:17
Просмотров 5 млн
Java abstraction 👻
5:30
Просмотров 126 тыс.
C++ in 100 Seconds
2:46
Просмотров 1,8 млн
Abstract Class and Abstract Method in Python
12:29
Просмотров 349 тыс.
Abstract Class In Java Tutorial #79
8:55
Просмотров 535 тыс.
Inheritance in Java Tutorial #86
10:34
Просмотров 379 тыс.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Улучшил свои Apple Watch!
0:25
Просмотров 27 тыс.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
Просмотров 149 тыс.