Ask Question
6 July, 02:06

Can we declare top level classes as private or protected?

+5
Answers (1)
  1. 6 July, 05:55
    0
    Answer and Explanation:

    top level class can not be declare as private or protected. It is always public. If we declare a top level class as private then the compiler always complain that the private is not allowed and if we declare top level class as protected then compiler complain that modifier protection is not allowed here. so we can not declare top level class as private or protected
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Can we declare top level classes as private or protected? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers