In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to analyze abstract. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Abstract class: abstract
Abstract: not specific, can not understand. Abstract class representation.
In the process of continuous extraction, the method declaration in the common content is extracted, but the method is different and there is no extraction, so the extracted method is not specific and needs to be marked by the specified keyword abstract and declared as an abstract method.
The class of the abstract method must be marked as an abstract class, that is, the class needs to be modified by the abstract keyword.
The characteristics of the abstract class:
1: abstract methods can only be defined in abstract classes, abstract classes and abstract methods must be modified by the abstract keyword (classes and methods can be described, not variables).
2: abstract methods only define method declarations, not method implementations.
3: abstract classes cannot be created objects (instantiated).
4: the subclass can be instantiated only if it inherits the abstract class and overrides all abstract methods in the abstract class. Otherwise, the subclass is still an abstract class.
Details of the abstract class:
1: is there a constructor in the abstract class? Yes, used to initialize subclass objects.
2: can non-abstract methods be defined in abstract classes?
Sure. In fact, there is not much difference between abstract classes and general classes, they all describe things, but when abstract classes describe things, some functions are not specific. Therefore, both abstract classes and general classes need to define attributes and behaviors. It's just that there is one more abstract function than the normal class. And there is one less part of creating an object than a normal class.
3: the abstract keyword abstract and what can't coexist? Final, private, static
4: is it possible not to define abstract methods in abstract classes? Sure. The purpose of abstract methods is simply to prevent the class from creating objects
This is the end of the analysis on how to carry out abstract. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.