#44 Default vs Parameterized Constructor in Java

preview_player
Показать описание
Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO20 (20% Discount)

Udemy Courses:

For More Queries WhatsApp or Call on : +919008963671

In this lecture we will learn:
- Types of constructors in Java
- What are Parameterized constructors?
- What are default constructors?

A constructor in Java is a special method that is used to initialize objects.

Parameterized Constructor:-
- A constructor that takes some parameters is known as parameterized constructor.
- The parameterized constructor is used to provide different values to different objects.

Default Constructor:-
- A normal constructor is known as the default constructor.
- If you do not create any constructor, then java creates a default constructor. That constructor will be blank with no parameters.
- The default constructor is used to provide the default values to the object like 0, null, etc., depending on the type.

- The default constructor can change into the parameterized constructor. But Parameterized constructor can’t change into the default constructor.

More Learning :

Donation:
PayPal Id : navinreddy20
Комментарии
Автор

the way you teach is just awesome sir 🤩

harshbadaya
Автор

When we print the obj1.setage() method, it is necessary to set the value inside the ().

karthiknp
Автор

Is the setAge method necessary after the constructor has been added?

rubyhashtaggarcia
Автор

Does creating a constructor, also creates a seperate Stack for it?

shanushah
Автор

3:25
Source + Action

**Generate Constructors, Methods, Functions, Getters, Setters.

kvelez
Автор

00:01 Customizing values in constructors in Java
00:40 Adding parameterized constructor in Java
01:17 Difference between default and parameterized constructors in Java.
01:55 Default constructor vs parameterized constructor in Java
02:34 Default Constructor is automatically created if no Constructor is defined
03:11 Default vs Parameterized Constructor
03:53 Default and parameterized constructors in Java
04:30 Default and parameterized constructors in Java

sambitkumar