#49 Single and Multilevel inheritance in java

  Рет қаралды 61,595

Telusko

Telusko

Жыл бұрын

Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
Udemy Courses:
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
Java For Programmers:- bit.ly/javaProgrammers
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
In this lecture we will learn:
- Types of inheritance in Java
- Single inheritance in Java
- Multilevel inheritance in Java
- Examples related to single and multilevel inheritance
Single Inheritance:-
- In single inheritance, subclasses inherit the features of one superclass.
- Only one parent class exists in single inheritance.
- It is when there are only two classes.
e.g.,
Calc class inherits the properties of AdvCalc class.
Here, Calc - child class
AdvCalc - parent class
Multi-level inheritance:-
- In Multilevel Inheritance, a derived class will be inheriting a base class, and as well as the derived class also acts as the base class for other classes.
- More than one parent class exists in multilevel inheritance.
- It is when we have multiple layers in between the classes.
e.g.,
Calc class inherits the properties of AdvCalc and further AdvCalc inherits the properties of VeryAdvCalc.
Here, Calc - child class
AdvCalc - parent class of Calc & child class of VeryAdvCalc
VeryAdvCalc - parent class of both other classes
Github repo : github.com/navinreddy20/Javac...
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Пікірлер: 7
@RamSingh-xg9bq
@RamSingh-xg9bq 2 ай бұрын
Nice explanation sir😊
@dProfessor_
@dProfessor_ 9 ай бұрын
SUPERB
@MajorPickleSwag
@MajorPickleSwag 10 ай бұрын
Since the Calc class inherits from the Object class, doesn't that mean single-level inheritance only applies to Calc -> Object? That would mean AdvCalc -> Calc -> Object is the beginning of multi-level inheritance from those series of classes.
@ahmedry6389
@ahmedry6389 3 ай бұрын
You too good buddy
@pankajsinghpatwal
@pankajsinghpatwal 4 ай бұрын
❤❤
@kvelez
@kvelez 9 ай бұрын
public class Main{ public static void main(String[] args) { SciCalc obj = new SciCalc(); System.out.println(obj.add(8, 3)); System.out.println(obj.mult(8, 3)); System.out.println(obj.sub(4, 9)); System.out.println(obj.div(4, 9)); System.out.println(obj.powered(7, 2)); } } class Calc{ public int add(int n1, int n2){ return n1 + n2; } public int sub(int n1, int n2){ return n1 - n2; } } class Advanced extends Calc{ public int mult(int n1, int n2){ return n1 * n2; } public int div(int n1, int n2){ return n1 / n2; } } class SciCalc extends Advanced{ public double powered(int n1, int n2){ return Math.pow(n1, n2); } }
@AYANKHAN-sp6qq
@AYANKHAN-sp6qq 12 күн бұрын
systum
#50 Multiple Inheritance in Java
6:36
Telusko
Рет қаралды 66 М.
#48 What is Inheritance in Java
8:47
Telusko
Рет қаралды 105 М.
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 87 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 27 МЛН
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 7 МЛН
#51 This and Super Method in Java
12:11
Telusko
Рет қаралды 87 М.
Python Classes in 1 Minute!
1:26
b001
Рет қаралды 167 М.
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 756 М.
UML class diagrams
12:24
Lucid Software
Рет қаралды 369 М.
Java inheritance 👪
6:11
Bro Code
Рет қаралды 244 М.
5 qualities of a trainer
3:51
Solomon Salvis
Рет қаралды 12 М.
Abstract Classes and Methods in Java Explained in 7 Minutes
7:00
Coding with John
Рет қаралды 485 М.
ИГРОВОВЫЙ НОУТ ASUS ЗА 57 тысяч
25:33
Ремонтяш
Рет қаралды 292 М.
Asus  VivoBook Винда за 8 часов!
1:00
Sergey Delaisy
Рет қаралды 1,2 МЛН
💅🏻Айфон vs Андроид🤮
0:20
Бутылочка
Рет қаралды 742 М.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
ЗЕ МАККЕРС
Рет қаралды 138 М.
Simple maintenance. #leddisplay #ledscreen #ledwall #ledmodule #ledinstallation
0:19
LED Screen Factory-EagerLED
Рет қаралды 8 МЛН
Ультрабюджетная игровая мышь? 💀
1:00