Computer Science, asked by wilkersonaiden2006, 4 months ago

plz Explain what constructors are, and describe how they are created in Java.

Answers

Answered by Anonymous
1

Answer:

\huge {\mathbb ♡{\orange{}\green{Ans}\pink{wer}\blue{!}}}♡

Constructor is a block of code that initializes the newly created object. A constructor resembles an instance method in java but it's not a method as it doesn't have a return type

.Rules for writing Constructor:

☆Constructor(s) of a class must have same name as the class name in which it resides.

☆A constructor in Java can not be abstract, final, static and Synchronized.

☆Access modifiers can be used in constructor declaration to control its access i.e which other class can call the constructor.

Explanation:

ᎻᎾᏢᎬ ᎨᎿ ᎻᎬᏝᏢᏕ ᎽᎾᏬ ᎠᎬᎯᏒ ✌

ᎻᎯᏉᎬ Ꭿ ᎶᏒ8 ᎠᎯᎽ ᎯᎻᎬᎯᎠ :)

Similar questions