The HellowWorld example is not the best fit to show how public and private work. It's much more clear with typical data structures like Stack, List etc. or with domain entities like Order, Invoice etc.
I appreciate the feedback, but I’m not sure I agree (at least with the first part). If we’re talking beginners, they aren’t going to be able to handle data structures beyond arrays (maybe ArrayLists, LinkedLists)—especially data structures in java which leverage generic types. If they knew those things already, then they probably wouldn’t need this article.
As for domain entities, to be quite honest, I’ve never heard that term. Granted, if we’re just talking about user-defined classes, then that’s fair. I just felt like it was important to come full circle on the example at the beginning of the article. When I get the chance, I’ll extend the last section to include a better example. Thanks!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The HellowWorld example is not the best fit to show how public and private work. It's much more clear with typical data structures like Stack, List etc. or with domain entities like Order, Invoice etc.
I appreciate the feedback, but I’m not sure I agree (at least with the first part). If we’re talking beginners, they aren’t going to be able to handle data structures beyond arrays (maybe ArrayLists, LinkedLists)—especially data structures in java which leverage generic types. If they knew those things already, then they probably wouldn’t need this article.
As for domain entities, to be quite honest, I’ve never heard that term. Granted, if we’re just talking about user-defined classes, then that’s fair. I just felt like it was important to come full circle on the example at the beginning of the article. When I get the chance, I’ll extend the last section to include a better example. Thanks!