2014/10/23 Java Basic Records (2)

Source: Internet
Author: User

is a leisurely day, look at the basic knowledge of securities, and then to learn the Java knowledge of the freshman sophomore, strive not to be a non-programming it people.

1, Final: Modifies the member variable, the variable can only be assigned at the time of creation or constructed.
Modifies the base member variable, which is no longer assignable, and when the reference variable is modified, the reference object is immutable, but the value of the reference object itself is variable.
Decorated classes, the final decorated class can have no subclasses, because subclasses can override the parent class's methods to alter the implementation details of the parent class.
2, abstract class: Abstraction, abstract class is to put several classes to find common ground, the formation of a class, a general template, the implementation of this abstract class needs to implement abstract methods in the abstract class, to avoid the arbitrary implementation of subclasses, abstract classes can contain ordinary methods. Inheriting a class with extends, can inherit only one parent class

3, interface interface: does not contain the common method, all methods are abstract methods, it is to implement the behavior specification of multiple classes. Implement interface with implements, can implement multiple interfaces.

4, Java container: Set,list,queue inherit collection. Set as a container, put objects in, but not into duplicate data, no sorting;
HashSet class: The object is stored by the Hashcode () method to obtain the Hashcode value, and then based on this value determines the location of the object, so the object is fast.

5, collection can use the iterator interface to traverse the collection element, the iterator interface hides the underlying details of various collection implementations, providing the application with a consent programming interface that iterates through the collection collection elements.

6. Another traversal method for collection is a foreach () loop traversal.

2014/10/23 Java Basic Records (2)

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.