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 – Bulkhead
- Interpreter Design Pattern
- Concurrency API Improvements
- Java – Variables
- HTML Blocks
- Java – Installation
- HTML Responsive
- Microservices – Components
- Write a Java program to check if given String is palindrome or not
- HTML Basics
- JavaScript How To Use
- Maven – Overview
- JavaScript Dates
- JavaScript Strings
- HTML SVG
- What are the core interfaces in Hibernate framework?
- HTML Layout
- CSS Pseudo-class
- Observer Design Pattern
- CSS Box Model