java coding adventure

Getting lost on the trail: what when there’s no keyword?

But Calculator's attributes have no keyword! In last adventure, I told you that you can use the public keyword in class declaration or before every class member: attribute and method. When something is public it's known everywhere. You've seen public class and public methods. Then you looked at the code and you've noticed: And you… Continue reading Getting lost on the trail: what when there’s no keyword?

java coding adventure

Visit in the museum: access level – public (and what it means in Java)

Class declaration Do you remember class declaration of Calculator? You know it's a class because of the keyword class before the class name. But what's the public there? Imagine your Java project is a town and every class is a building. In the town, everyone can visit public places like the museum or the cafe.… Continue reading Visit in the museum: access level – public (and what it means in Java)