Category: java
java
Java Learning – Constructors and Attributes
The main role of a constructor is to initialize an object, not to create the object.When an object is created,
Read More
java
Java Learning – Constructor chaining
Constructor chaining refers to invoking one constructor from another within the same class. This technique offers several benefits, including: Consider
Read More
java
Java learning – Immutability with Records – Constructors
Records, in Java, can help to implement immutability due to their inherent properties and restrictions. Here’s an example illustrating how
Read More
java
Java Learning – Multiple Constructors
A Java class can have multiple constructors. A default no-parameter constructor, as described in a previous post, and overloading constructors,
Read More
java
Java Learning: Default Constructor
The objective of a constructor is to create an object from a class blueprint. Since the main idea of this
Read More