Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:01:32+00:00 2026-05-24T00:01:32+00:00

What could have been the design decision behind restricting a class to either public

  • 0

What could have been the design decision behind restricting a class to either public or default level access? The protected member is more visible than a default, then why skip protected?

EDIT: I meant TOP level classes

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:01:33+00:00Added an answer on May 24, 2026 at 12:01 am

    The visibility level of classes is not the same as that of members!

    With members the whole idea of subclassing comes into play, hence the notion of “protected.”

    But with classes, you are either visible outside your package or you are not. There is no real notion of being or not being visible to your subclasses. It would be odd, wrong actually, if a subclass could not see its superclass.

    In addition, subpackages don’t really work like subclasses, so again, “protected” on classes just really doesn’t work.

    BTW we are talking here of top-level classes, right? Member classes are a different story.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been searching everywhere but I could not find an answer. I need
I have been working on designing a file server that could take the load
I have been looking for an answer to this and could not find it
I have been looking for an answer for some time now, hope you could
I have been brushing up on my design patterns and came across a thought
I have been struggling with this for a while and could really use some
I have been working on trying to leverage data contained in an Access Database
all. I've been thinking about a design decision for a PHP form and I'd
I have been told that the Provider pattern is a way to design loosely
I have been for an interview, they asked me a question which I could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.