Computer Science, asked by 25197, 7 months ago

what is the purpose of a constructor in a java class?

Answers

Answered by Anonymous
4

The purpose of constructor is to initialize the object of a class while the purpose of a method is to perform a task by executing java code. Constructors cannot be abstract, final, static and synchronised while methods can be. Constructors do not have return types while methods do.

itzDopeGirl

Answered by Itzraisingstar
10

Answer:

Explanation:

The purpose of constructor is to initialize the object of a class while the purpose of a method is to perform a task by executing java code. Constructors cannot be abstract, final, static and synchronised while methods can be. Constructors do not have return types while methods do.

Hope it helps you.

Similar questions