Mastering Java and Spring Boot - Live Course : https://bit.ly/TeluskoJavaLive
For More Queries WhatsApp or Call on : +919008963671


In this lecture we will learn:
- Constructors in Java
- Super method in Java
- Object class in Java
- This method in Java
- Similarities in between this() and super() method


#1
- Whenever you call an object, it will create a constructor of a class.
- When we create an object of a class that it calls the constructor of a sub-class as well as a constructor of a superclass.
- If you do not pass any value in an object, then it will call the default constructor of a class.
- But if you pass the value in an object, then it will call the parameterised constructor of that class.

#2
Super() method:-
- Every constructor in Java has a method, even if you do not mention it.
- By default, the first statement in every constructor is a method called a super() method.
- Super() method means calls the constructor of a superclass.
- If you do not pass any parameter in a super method, then it will call the default constructor of a superclass.
- If you pass any parameter in a super method, then it will call the parameterised constructor of a superclass.
- To call the parameterised constructor of a parent class, we need to explicitly call the super method.

#3
Object class:-
- Every class in Java extends the Object class, even if you do not mention it.
- Object is a class in Java that contains a lot of methods.
- So, the super method of a superclass calls the constructor of an object class.
- There is multi-level inheritance in this concept.

#4
This() method:-
- this() method calls the constructor of the same class.
- If you do not pass any parameter in this method, then it will call the default constructor of the same class.
- If you pass any parameter in this method, then it will call the parameterised constructor of the same class.

#5
Similarities in between this() and super() method:-
- We can use both this and super method anywhere except the static area.
- Both this and super method can be used any number of times in a code.
But both can be used only one time inside a constructor.
- Both are non-static keywords.

Github repo : https://github.com/navinreddy20/Javacode.git

Java:- https://bit.ly/JavaUdemyTelusko
Spring:- https://bit.ly/SpringUdemyTelusko

More Learning :

Java :- https://bit.ly/3x6rr0N
Python :- https://bit.ly/3GRc7JX
Django :- https://bit.ly/3MmoJK6

JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq

Rest Api :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA

Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB

NoSQL Tutorial :- https://bit.ly/3aJpRuc
Mysql Tutorial :- https://bit.ly/3thpr4L

Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu

Donation:
PayPal Id : navinreddy20
https://www.telusko.com