Think in Java 1

Source: Internet
Author: User

Booch A concise description of the object is that the object has state, behavior, and identity, which means that each object can have internal data and methods, and each object can be uniquely distinguished from other objects, specifically, each object has a unique address in memory.

Think of the object as a service provider, extract the problem from the surface, consider what kind of object can solve the problem, whether the object is already present, if it doesn't exist, what they look like, what services they can provide, what other objects they need to fulfill their obligations, and if they continue to do so, is a reasonable way to break the problem down into a collection of objects.

The flexibility of combination than inheritance???? In fact, when creating a new class, you should consider the combination first, because he is simpler and more flexible, and in this way the design becomes clearer.

The equivalence of types derived from inheritance is an important threshold to understand the connotation of object-oriented programming method.

Java garbage collector is a significant improvement over C + +, thanks to 1, all objects inherit from the single-rooted class object

2. Objects can only be created in one way (created on the heap)

The size of the storage space for Java primitives is constant, and this invariance is one of the reasons why Java programs are more portable than other language programs.

The program appears to be just a series of object combinations with methods that use other objects as arguments and send messages to other objects.

Javadoc is a tool for extracting annotations that can automatically parse the information tagged by the comment tags, so that we can generate fairly good program documentation with minimal effort.

When assigning a value to an object, the actual operation of an object is a reference to the object, so if one object is assigned to another, the reference is actually copied from one place to another. This error is called an alias phenomenon. There is also an alias problem when passing an object to a method.

Compares two objects for the same, using the method equals (), but for the base type use = = directly and! = Can

Java allows us to convert any basic data type to another base data type, except for the Boolean type, because he doesn't allow any type of conversion processing at all.

Think in Java 1

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: 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.