Abstract class
1. An abstract class is a class that has an abstract keyword in front of the class and an abstraction method (which adds the abstract keyword before the class method function keyword).
2. Abstract classes cannot be instantiated
Directory
I. Reasons for not needing to instantiate
I. Types that cannot be instantiated
Second, abstract class
Third, the interface
3.1. Why interfaces are required
3.2, the characteristics of the interface
Interfaces can inherit Interfaces. Abstract classes can implement (implements) interfaces, and abstract classes can inherit concrete Classes. There can be static main methods in an abstract class.Q: Does an abstract class inherit entity classes
/*When the same functionality appears in multiple classes, but the functional body is different,This is available for upward extraction. At this point, only the function definition is extracted, not the functional body.Abstract: Can not
Directory:
[C # tips] C # some confusing concepts -------- data type storage location, method call, out and ref Parameters
[C # tips] C # some confusing concepts (ii) -------- constructor, this keyword, partial classification, enumeration [C #
Java:1, ordinary Java class can be added to the class before the abstract declaration as an abstraction, just at this time the class can no longer be instantiated.2. Suppose that there is more than one abstract method in a class. Then the class must
Scala Abstract classAbstract classScala defines abstract classes
An abstract class cannot be instantiated.
A class that contains an abstract method must be defined as an abstract class, that is, using the abstract keyword to
5.5
Abstract classes, interfaces, and packages
5.5.1
Abstract class
Suppose we're going to write a calculation of the area and perimeter of a rectangle, triangle, and circle.
program, if you are programmed in the way we learned before, we must
5.1 Abstract classes and abstract methodsBefore a class is preceded by the "abstract" keyword, this class becomes an abstract class.Corresponding to a method class preceded by the "abstract" keyword, this method becomes an abstract method.Abstract
Key words:type– typeClass-ClassesAbstract-abstractedInterface-InterfaceMember-MembersMethod-MethodsProperty-PropertiesPre-Knowledge: You should understand when reading this article. NET programming knowledge and has mastered class, Abstract class
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.