Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

#51 This and Super Method in Java

262.6K views on YouTube

Check out our courses:

Agentic AI Engineering with Python : https://go.telusko.com/agentic-ai-python
Coupon: TELUSKO10 (10% Discount)

Master Java Spring Development : https://go.telusko.com/learn-master
Coupon: TELUSKO10 (10% Discount)

For More Queries WhatsApp or Call on : +919008963671

website : https://telusko.com/

Udemy Courses:

Java Spring:- https://go.telusko.com/Udemyjavaspring
Java:- https://go.telusko.com/udemyteluskojava
Spring: https://go.telusko.com/udemyteluskospring
Java For Programmers:- https://go.telusko.com/javaProgrammers
Python : https://go.telusko.com/udemyteluskopython
Git : https://go.telusko.com/udemyteluskogit
Docker : https://go.telusko.com/udemyteluskodocker

Instagram : https://www.instagram.com/navinreddyofficial/
Linkedin : https://in.linkedin.com/in/navinreddy20
WhatsApp : https://go.telusko.com/whatsapp
Discord : https://discord.gg/D8hWe9BqfF

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

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