Ask Question

Can we declare top level classes as private or protected?

+4
Answers (1)
  1. 6 April, 20:31
    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?
Find an answer to your question 👍 “Can we declare top level classes as private or protected? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers