Why interfaces dont have constructor ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why interfaces dont have constructor ??

Why interfaces dont have constructor ??

21st Dec 2017, 2:19 PM
Rishabh
Rishabh - avatar
4 Answers
+ 2
@Divyaraj constructors are only used to initialise variables ???
21st Dec 2017, 4:04 PM
Rishabh
Rishabh - avatar
+ 2
@divyaraj thanks bro !! but I'm searching for an exact answer ??
21st Dec 2017, 4:33 PM
Rishabh
Rishabh - avatar
+ 1
The data member of the interface are already initialized .Constructors of the special defined methods which are not permitted to defined and moreover interface data member are static.
21st Dec 2017, 3:58 PM
Divyaraj Yadav
Divyaraj Yadav - avatar
0
mainly yes but it is good for memory management.. which isn't possible with functions
21st Dec 2017, 4:30 PM
Divyaraj Yadav
Divyaraj Yadav - avatar