Java programming ideology notes

Source: Internet
Author: User
  • By providing constructors, the class designer can ensure that each object is initialized.
  • This policy is appropriate because the garbage collection mechanism also has overhead.
  • Finalize () is required because free () is used in the C language when memory is allocated.
  • The domain name is reversed to obtain a unique package name. The hierarchical file structure is used to solve the project file management confusion problem and the namespace problem.
  • Use inheritance to express the relationship "is-A is a", and use a combination to express the relationship "has-A has.
  • Use inheritance criteria: Determine whether to transform the new class to the base class.
  • Realize polymorphism through dynamic binding, send a message to the base class object, and let the object determine what to let the export class do.
  • The meaning of the interface: establish the protocol between classes; completely decouple; Combine multiple interfaces to achieve multi-inheritance without burdens.
  • The internal class can access all the members of its peripheral object without any special conditions.
  • Java uses a combination of internal classes to replace multiple inheritance of C ++.
  • Container provides a complete method of holding objects to solve complicated data structures.
  • With generics, you can prevent objects of the Error Type from being placed in the container during compilation.
  • The job of the exception handling program is to restore the program from the error State so that it can either run in another way or continue to run.

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.