Summer study concluded 4

Some of this week's study summary, this week read this learning java probably about 5 small bar, most of the time or in the code, there are about nine hours, this week has been more hands, the biggest gain is java the method defined class, and c ++ like form, but the actual nature or is different from the first class public class a () {}; if a defined target, usually ax = new a (); even such a construct objects, and eclipse on the computer they can not accept such usage, the name of the project where the class to use, such as call p, then advance to define a static object xu = new x () inside the class; such an action would be completed before the object definition, ax = u.new a ();

However, direct definition of ax; no error will be complete compilation, but x was not content, he is just a pointer, and this class definitions about the ways java, java object names are similar to what exists pointers, they point address data, so that the definition is the way it is allocated to them, but also because of this, "==" data can not compare the two objects are the same, because they only address, the contents can not be compared, "=" is only the copy the address, and then let the same area pointer to the left and to the right, not to copy the data, and that area before pointing it can not be visited.

Previous summarize always wanted to learn what they are summed up, some of it later or thin, tasteless remove some things, and more sum up some gains after overcoming the problem of it.

Guess you like

Origin www.cnblogs.com/liuleliu/p/11260764.html