#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 М.
#51 This and Super Method in Java
12:11
Telusko
Рет қаралды 87 М.
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 26 МЛН
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 18 МЛН
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 4,4 МЛН
#48 What is Inheritance in Java
8:47
Telusko
Рет қаралды 105 М.
Inheritance in Java Tutorial #86
10:34
Alex Lee
Рет қаралды 379 М.
#53 Packages in Java
12:20
Telusko
Рет қаралды 157 М.
Multithreading in Java Explained in 10 Minutes
10:01
Coding with John
Рет қаралды 886 М.
#52 Method Overriding in Java
7:57
Telusko
Рет қаралды 114 М.
#65 Need of Interface in Java
8:32
Telusko
Рет қаралды 109 М.
MULTI LEVEL & HIERARCHICAL INHERITANCE - JAVA PROGRAMMING
28:37
Sundeep Saradhi Kanthety
Рет қаралды 133 М.
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 756 М.
Java polymorphism 🏁
6:12
Bro Code
Рет қаралды 112 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,4 МЛН
Simple maintenance. #leddisplay #ledscreen #ledwall #ledmodule #ledinstallation
0:19
LED Screen Factory-EagerLED
Рет қаралды 8 МЛН
В России ускорили интернет в 1000 раз
0:18
Короче, новости
Рет қаралды 875 М.