Java Fundamentals (iii)

Source: Internet
Author: User
Abstract class

(1) Characteristics of abstract classes
A: Abstract classes and abstract methods must be modified with the keyword abstract
B: Abstract classes do not necessarily have abstract methods, but classes with abstract methods must be abstract classes
C: Abstract class cannot be instantiated
D: Subclass of Abstract class
A: is an abstract class.
B: is a specific class. This class must override all abstract methods in the abstract class.


(2) Characteristics of abstract class Members:
A: Member variables
There are variables, there are constants
B: Construction method
There are construction methods
C: Member Method
There is abstraction, there is non-abstract

Local inner class

Local internal classes access local variables, and local variables are subject to the final modification reason:

Because the local variable is freed when it is used, the data of the heap memory does not disappear immediately, so it is necessary to ensure that the heap memory is also able to use the variable, and the final

Java Fundamentals (iii)

Related Article

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.