Thinking in Java 4th memo

Source: Internet
Author: User

1. view objects as service providers
2. SetProgramPersonnel are divided into class (data type) creators and client programmers by role
3. One of the major changes to Java se5 is the addition of parameterized types (fan type)
4. added the concept of static import in Java se5.
5. When float or double is converted to an integer value, the number is always truncated. To get the rounding result, you need to use the round () method in Java. Lang. Math.
6. Garbage Collection: Adaptive, generational, stop-copy, and marked cleaning Garbage Collector
7. The Enum keyword is added to Java se5 and can be used in switch statements.
8. In the same package, the package permission method can be inherited. In different packages, the package permission method must be protected or later.
9. whether to use combination or inheritance, the clearest way to judge is to ask whether you need to transform from a new class to a base class (upcasting)
10. Only non-private methods can be overwritten. The export class method with the same name as the base class private method is a new method, so it is best not to have the same name.
11. only common method calls can be polymorphism, and the domain and static method are not polymorphism. the Same Name Domain actually allocates different buckets, static methods are associated with classes rather than individual objects.
12. added the covariant return type in Java se5, which indicates that the overwritten method in the export class can return a certain export type of the return type of the base class method.

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.