QuesHub > 函数 > 抽象 > 静态 > ASK DETAIL

Can we declare constructor as abstract?

Isabella Patel | 2023-06-09 06:18:37 | page views:1344
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Harper Martin

Studied at the University of Amsterdam, Lives in Amsterdam, Netherlands.
Why can't constructors be final, static or abstract in Java? ... When you set a method as 'static', it means: --Method belong to class, not a particular object-- but constructor implicitly called to initialize an object, so there is no purpose in having a static constructor.Aug 16, 2014
2023-06-11 06:18:37

Isabella Gonzales

QuesHub.com delivers expert answers and knowledge to you.
Why can't constructors be final, static or abstract in Java? ... When you set a method as 'static', it means: --Method belong to class, not a particular object-- but constructor implicitly called to initialize an object, so there is no purpose in having a static constructor.Aug 16, 2014
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4