Get the latest tech news
Public/protected/private is an unnecessary feature
make_car with return type Vehicle. Since Car can't restrict subclasses to only use an interface, any subclasses can violate Car's internal invariants.
As far as I can tell from extensive research, the inventors and users at that time simply didn't realize that access modifiers duplicated the interface-defining features that were already available: virtual methods and subtyping, which together are sufficient to . It's important to realize that, in the absence of inheritance, access modifiers provide no additional implementation-hiding power if you have interfaces. If your class isn't available to be subclassed (say, because it's final), and you're restricting construction of it as in point 2 above, then there's absolutely no need to annotate it with access modifiers.
Or read this on Hacker News