Joke Collection Website - Cold jokes - About Java object-oriented understanding

About Java object-oriented understanding

You have misunderstood. Food is a class, and bread is also a class. Bread is a type of food. Bread has the characteristics of food, such as being edible, having taste, etc. Learn how to inherit it. Here, bread is a subclass inherited from food, which is a parent-child relationship. Of course, there are many breads, and there are also many subcategories of bread, but what is the meaning of objects? It is a real thing, such as the bread placed in front of you. You can eat the bread now. It is an instance of bread, belonging to bread, and it is a relationship of belonging. Do you understand?