Java Tutorial Part32 | Constructors|Types of Constructor|Default and Parameterized

Published: 16 November 2023
on channel: ARIVU INFO
14
0

Java Tutorial Part32 | Constructors|Types of Constructor|Default and Parameterized|Initialization through Constructors

Rules for creating Java constructor
Constructor name must be the same as its class name
A Constructor must have no explicit return type

Types of Java constructors
Default constructor (no-arg constructor)
Parameterized constructor

A constructor is called "Default Constructor" when it doesn't have any parameter.
If there is no constructor in a class, compiler automatically creates a default constructor.

What is the purpose of a default constructor?
The default constructor is used to provide the default values to the object like 0, null, etc., depending on the type.

A constructor which has a specific number of parameters is called a parameterized constructor.

Why use the parameterized constructor?
The parameterized constructor is used to provide different values to distinct objects.

If this video is useful to you, please like and share If you didn't subscribe kindly subscribe. So that you will get a notification about my new videos

Python Course full playlist:    • Python Tutorial in Tamil  
C Language Course full playlist:    • C Language Full Course  
Python Course English full playlist:    • Python Tutorial in English  
Java Course English full playlist:    • Java Tutorial in English  
Subscribe to our channel by clicking here 👉👉🏾    / @arivuinfo_6666  
#ARIVU_INFO


On this page of the site you can watch the video online Java Tutorial Part32 | Constructors|Types of Constructor|Default and Parameterized with a duration of hours minute second in good quality, which was uploaded by the user ARIVU INFO 16 November 2023, share the link with friends and acquaintances, this video has already been watched 14 times on youtube and it was liked by 0 viewers. Enjoy your viewing!