Start your brain in class

Source: Internet
Author: User

To understand the use of super, you first know that super is used to call the base class (the parent Class).

1.super. A method or variable of the parent class that invokes the parent class's method or variable in the subclass.

2.super (parameter) is used to invoke a constructor that has the same parameters in the parent class.

The main thing is that super is used to refer to the parent class.

Use of Abstract:

1. The addition of abstractions to a class or method constitutes an abstract class or abstract method.

2. Abstract class only the declaration of a method is not defined, it needs to be overridden in a subclass, and the class containing the abstract method must be an abstract class.

3. Abstract classes can have both abstract methods and non-abstract methods, it is important to note that the subclass of the inherited abstract class must implement all the abstract methods of the parent class, otherwise the subclass is an abstract class.

4. Abstract classes are not able to create objects.

Start your brain in class

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.