Top level classes in java can’t be private or protected, but inner classes in java can. The reason for not making a top-level class as private is very obvious, because nobody can see a private class and thus, they cannot use it. Declaring a class as protected also doesn’t make any sense. The only difference between default visibility and protected visibility is that we can use it in any package by inheriting it. Since in java there is no such concept of package inheritance, defining a class as protected is no different from default.
Read More
- Microservices – Communication between Services
- Maven – Overview
- JavaScript Functions
- Java – Access Modifiers
- Hibernate Architecture
- How can we create a Thread in Java?
- HTML Id
- CSS Fonts
- Microservices – Security
- HTML Symbols
- Observer Design Pattern
- JavaScript Break
- Write a program to reverse String using recursion in Java
- How component scanning works in Spring?
- Lambda Expressions
- Write JDBC steps to connect to MySQL database in Java
- Microservices – Demo Application
- List out the dependency scopes in Maven
- How do you get sources Jars from Maven Repository?
- CSS Opacity