What is the tutorial for beginners of Java? Of course, it is 30 basic concepts that need to be mastered for Java beginners. Mastering these concepts is of great benefit for learning java. students who are learning Java programming can come and see the updates today.
1. the only link in OOP is what the interface of the object is. Just like a computer vendor, no matter what the internal structure of the power supply is, it only depends on whether it can provide electricity to you, that is, as long as you know can or not rather than how and why. All programs are composed of certain attributes and behavior objects. Different objects are accessed through function calls, And all communication between objects is done through method calls, by encapsulating object data, the reuse rate is greatly improved.
2. The most important idea in OOP is the class. The class is the blueprint of the template. An object is constructed from the class, that is, an instance of the class is created ).
3. encapsulation: it refers to the implementation process of combining data and behavior in a package) and hiding data for the object user. The data in an object is called its instance field ).
4. Expand a class through the computer city installation edition to obtain a new class called inheritance. All classes are extended by the object root Super class. The root Super class will be introduced below.
5. Three main features of the object
Ehavior --- describes what this object can do.
Tate-the reflection of an object when the object applies a method.
Dentity --- a distinction between dentity and other similar behavior objects.
Each object has a unique indentity, which affects each other.
6. Relationships between classes:
Use-A: dependency
Has-A: Aggregation relationship
Is-A: inheritance relationship -- for example, Class A inherits class B. At this time, Class A not only has class B's methods, but also its own methods. (personality exists in commonalities)
7. constructor for constructing objects: constructor is a special method for constructing and initializing objects.
For example, the data constructor is called data.
EW data () --- construct a new object and initialize the current time.
Data happyday = new data () --- assign an object to a variable happyday so that the object can be used multiple times. The declared variables and object variables are different. the value returned by new is a reference.
Constructor features: constructor can have 0, one or more parameters; constructor and class have the same name; one class can have multiple constructor; constructor has no return value; the constructor is always used with the new operator.
8. Overload: when multiple methods have the same name and contain different parameters, the overload occurs. The compiler must select the method to call.
9. Package Java allows one or more classes to be collected together into a group called a package for organizing tasks. The standard Java library is divided into many packages. Java. Lang java. util Java, net, etc. packages are hierarchical. All Java packages are within the Java and javax package layers.
10. inheritance: allows you to create new classes based on existing classes. When you inherit an existing class, you reuse the methods and fields of this class, you can also add new methods and fields in the new class.
11. extension class: the extension class fully embodies the inheritance relationship of is-a. Form: Class (subclass) extends (base class ).
12. Polymorphism: in Java, object variables are polymorphism. Java does not support multi-inheritance.
13. dynamic binding: Call the object method mechanism.
(1) The Compiler checks the object declaration type and method name.
(2) The Compiler checks the parameter types of method calls.
(3) Static binding: if the method type is priavte static final, the compiler will know exactly which method to call.
(4) When a program is running and dynamic binding is used to call a method, the virtual machine must call the method version that matches the actual type of the object pointed to by X.
(5) dynamic binding: it is an important feature that enables programs to be scalable without the need to re-compile existing code.
- Previous Resource: Talking about how to use three built-in cooling methods in win7
- Next Resource: How to Implement Windows XP Remote Management