1 Object-oriented and process-oriented
Features of 2.OO
(1) Encapsulation
(2) Inheritance
(3) Polymorphism
3.Class and Object
(1) Define a class
(2) gloables and local variables
(3) constructor ' s defination and application
(4) Create an object
Declration an Object
Allocate memory
(5) Use an object
Use the member variables and change them
Use the member function
Use operator '. ' To access the member variables and functions
(6) Deallocate an object
Java use the ' garbage collection ' to deallocate the Memory:first:estimate whether a variable are in use; Second:deallocate
Java also provide a function "finalize ()" Before "garbage collection" for "garbage collection System" (Got hazed, GCs are D Iffer from GC?)
4.use Packages
def: (1) In essence facilate the search and use of a specfic class
(2) There exists the Cogniminal class, to some extent, this can avoid the conflict of nominate
(3) In Java, Access right, measured in packages
Create a package:
Use classes in the same package and public classes in other packages:
(1) long names connected by dot
(2) Use keyword ' import ': Import pack.class|*
This article is from "Maugham's Advanced Journey" blog, please make sure to keep this source http://maugham.blog.51cto.com/13056751/1969777
Java and object-oriented design