Object-oriented design

I had to go training, but I have no money, had no choice but to find a video on the Internet to see.

Some time ago, because some things, delayed for a long time, and now again begin to learn.

I want to be a Java development engineers, wages 7k ~ 9k enough.

 

First, the computer language objects described problem domain things, by the object attribute (attribute) and methods (method)

Correspond to things by having static and dynamic attributes

 

a, a class is an abstract concept described objects of the same type of class defines the class object has static and dynamic properties.

B, a template class can be viewed as a class of objects, objects can be viewed as a specific instance of the class.

 

When considering the issue, a, first consider this question should have which classes and which objects

      B, then consider each type and the object, which should have the properties and methods

      C, and finally have to consider what kind of relationship between classes and (association, aggregation, inheritance ......)

 

Second, the object

a, the object is the core of the Java program, the Java program "all things are objects"

b, the object can be seen as static properties (member variables) and dynamic properties (method) of the package

c, class is used to create objects of the same type of "template", defines the member variables and methods in the class has a class.

 

Third, the definition of Java classes

 

1, reference

  a, Java language in addition to the total basic types of variable types are called reference types

  b, Java objects are passed by reference in its operations

 

Parse the statement: String s = new String ( "hello world");

String s; // declare a reference variable of type String, but did not make it to an object

s = new String ( "hello world!"); // creates an object of type String using the new statement and s

It point, its operation can be completed later by s.

 

Class is a static concept, in the code area.

The object is new out, it exists in the heap memory. Each class member variables have different values ​​(except static variables) in different subjects

And when only one method, performed only take up memory.

 

2, commonly known as the naming convention

  a, the first letter of the class name uppercase

  The first letter lowercase b, variable names and methods

  c, using the hump logo

  Each Java file can be only one public class, and is the same Java file name.

 

3, the implementation process of memory

  

 

Guess you like

Origin www.cnblogs.com/langdao/p/11432756.html