#48 What is Inheritance in Java

  Рет қаралды 104,711

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:
- What is inheritance in Java?
- Use of extend keyword in inheritance
- The main aim of inheritance
- Important points related to inheritance
#1
For every class that we create in a code, there will be a class file.
- Inheritance helps to add more features by inheriting the class.
- For inheritance, we only required the class file. There is no need for a java file.
- extends keyword is used in inheritance to inherit properties of a parent class.
#2
- The main aim of inheritance is to implement the concept of reusability, saving our time and resources and also creating better connections between different classes, and achieving method overriding.
#3
Points related to inheritance in Java:-
- The superclass of every class is an Object class.
In the absence of any other explicit superclass, every class is implicitly a subclass of the Object class.
- A superclass can have any number of subclasses but a subclass can have only one superclass.
- Constructors are not members, so they are not inherited by subclasses, but the constructor of the superclass can be invoked from the subclass.
- A subclass does not inherit the private members of its parent class.
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

Пікірлер: 20
@bhuvanprasathk
@bhuvanprasathk Жыл бұрын
No one else can teach like you man! you are helping people a lot. Thank you naveen.
@aakashsinha9641
@aakashsinha9641 Жыл бұрын
"redundancy is crime" - navin reddy
@ShahriarShihab-lm8jd
@ShahriarShihab-lm8jd Жыл бұрын
your videos helped me a lot sir,Thank you so much..
@libspacemacj4590
@libspacemacj4590 7 ай бұрын
Telusko :"You know vhyyy?"
@user-ef9xs4mk7e
@user-ef9xs4mk7e 10 ай бұрын
amazing lecture and lecturer
@niksyt8666
@niksyt8666 Жыл бұрын
actually the your course is not for just the beginner … but what’s the good thing is that .. suppose there is a IT person who don’t study for a while and now he want to recall all then it’s perfect…. and the way you explain is not quickly hit to the new person but it helps when a person go to interview and if they will explain in your style 😂😂😂😂 it will surely selected bcz you are not tell us theory you tell us all practical knowledge which can be quick adopted by a IT Student 🙇🏻
@OneBitePls001
@OneBitePls001 7 ай бұрын
amazing dude💯💯💯
@RangaRajuth
@RangaRajuth Жыл бұрын
Simple superb
@user-zx3so5do1b
@user-zx3so5do1b 11 ай бұрын
What an amazing lecture! I have one question. In this case, I think it is much easier if I just create two those methods, multi() and div(), in the class Calc. But why we should make another class, AdvCalc?
@GOKULK-ll8ur
@GOKULK-ll8ur 11 ай бұрын
so that we have two calculators basic and advanced
@satishkk7548
@satishkk7548 3 ай бұрын
Nice video
@satishkk7548
@satishkk7548 3 ай бұрын
Nice
@kvelez
@kvelez 8 ай бұрын
public class Main{ public static void main(String[] args) { Advanced obj = new Advanced(); 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)); } } 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; } }
@c4domer
@c4domer 4 ай бұрын
why are tthere no coments
@prathameshpatil1023
@prathameshpatil1023 7 ай бұрын
Sir in my laptop it doesn't working with public keyword for classes.but without public keyword it executes Why this problem is occurring
@_sebastian1734
@_sebastian1734 4 ай бұрын
Hi, to use the public keyword, make sure you are out of the main class or package. Use a separate class name. i.e Student.java then make it public class Student{}. in the main class or package we can only use the default class
@rakeshreddy9145
@rakeshreddy9145 4 ай бұрын
class name should be same as file name if you use public keyword.
@Sehore_Defence_Academy
@Sehore_Defence_Academy Жыл бұрын
why you upload sir this series and you have also paid batch binary java batch so is difference in those course
@bhuvanprasathk
@bhuvanprasathk Жыл бұрын
i think those are live classes.
@athul03
@athul03 Жыл бұрын
Isnt that advanced level of java ?
#49 Single and Multilevel inheritance in java
3:51
Telusko
Рет қаралды 61 М.
#51 This and Super Method in Java
12:11
Telusko
Рет қаралды 87 М.
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 18 МЛН
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 69 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 170 #shorts
00:27
#52 Method Overriding in Java
7:57
Telusko
Рет қаралды 113 М.
#47 Need of Inheritance in Java
6:18
Telusko
Рет қаралды 59 М.
Java inheritance 👪
6:11
Bro Code
Рет қаралды 244 М.
Coding Was Hard Until I Learned THESE 5 Things!
7:40
Pooja Dutt
Рет қаралды 1 МЛН
#53 Packages in Java
12:20
Telusko
Рет қаралды 157 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 904 М.
#65 Need of Interface in Java
8:32
Telusko
Рет қаралды 109 М.
Java's Creators Rejected Multiple Inheritance - Here's Why
13:14
Coding with John
Рет қаралды 67 М.
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 27 МЛН
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 5 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,2 МЛН
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
ЗЕ МАККЕРС
Рет қаралды 103 М.