• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
November 15, 2022 |2.2K Views
Constructors in Java
  Share  3 Likes
Description
Discussion

In this video, we will be discussing Constructors from Java in detail. 

What are Constructors?

Constructor in Java is a special method that is used to initialize the objects. While creating the object, that time constructor will be called. Constructor can be used to set the initial values of an object. 

Rules for writing constructors: 

1. Class name and constructor name must be the same. 
2. A constructor in Java can not be abstract, final, static, or Synchronized. 
3. Access modifiers can be used in the constructor to control its access. 

Types of Constructors in Java: 

1. No-argument constructor/Default 
2. Parameterized Constructor 
 

Constructors in Java
https://www.geeksforgeeks.org/constructors-in-java/

Read More