plz Explain what constructors are, and describe how they are created in Java.
Answers
Answered by
1
Answer:
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
Math,
2 months ago
Science,
2 months ago
Computer Science,
4 months ago
Social Sciences,
4 months ago
Science,
9 months ago
English,
9 months ago