Can we define a class as protected in Java?

Oliver Campbell | 2023-05-05 14:10:00 | page views:1091
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Lucas Rivera

Works at the International Development Association, Lives in Washington, D.C., USA.
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-11 14:10:00

Riley White

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