QuesHub > private > can > methods > ASK DETAIL

Can you have private methods in an interface?

Julian Cook | 2023-06-09 06:34:35 | page views:1893
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Olivia Foster

Studied at Stanford University, Lives in Palo Alto. Currently working as a product manager for a tech company.
According to the Java programming language scope of the private members is limited to the class in which it is declared and can be accessed only by methods of that class . But inteface doesn't have a method body hence there is no use of declaring private members inside an interface .Apr 16, 2012
2023-06-17 06:34:35

Benjamin Brown

QuesHub.com delivers expert answers and knowledge to you.
According to the Java programming language scope of the private members is limited to the class in which it is declared and can be accessed only by methods of that class . But inteface doesn't have a method body hence there is no use of declaring private members inside an interface .Apr 16, 2012
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4