QuesHub > 声明 > 堆栈 > 嵌套 > ASK DETAIL

Can a class be private or protected in Java?

Zoe Gonzalez | 2023-05-05 14:09:55 | page views:1070
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Julian Turner

Works at the World Health Organization, Lives in Geneva, Switzerland.
Since there's no such concept as 'subpackage' or 'package-inheritance' in Java, declaring class protected or package-private would be the same thing. You can declare nested and inner classes as protected or private, though.
2023-05-07 14:09:55

Julian Mitchell

QuesHub.com delivers expert answers and knowledge to you.
Since there's no such concept as 'subpackage' or 'package-inheritance' in Java, declaring class protected or package-private would be the same thing. You can declare nested and inner classes as protected or private, though.
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4