We have always defined classes (class) for the purpose of producing objects. An object is a functional entity, and a class is a type classification of an object. This is a basic concept of object-oriented. Static data memberThere is some data to
The syntax of Java is basically the same as that of C #, after all, it is an object-oriented programming language. The following is a list of Java's unique and I do not learn in C # knowledge of grammarFirst, Java is an interpreted languageSecond,
1. Combination
Place object references for other classes in the new class.
3. Inheritance
Keyword extends a class inherits a base class and automatically obtains all the fields of the base class (including field reference
For the final keyword in Java, we can first understand the literal meaning, Baidu translation shows as follows: In other words, the final English meaning is final and cannot be changed. The corresponding meaning is also expressed in Java, you can
One, Java modifierThe Java language provides a number of modifiers, mainly divided into the following two categories:
Access modifiers
Non-access modifiers
1. Access Control modifiersIn Java, you can use access controls to protect
polymorphicEncapsulation creates a new data type by merging features and behaviors.The function of polymorphism is to eliminate the coupling relationship between types.method Call BindingDefinition: Associating a method invocation with the same
Final is a reserved keyword in Java that can declare member variables, methods, classes, and local variables. Once you have the quote declared final, you will not be able to change the reference, the compiler will check the code, and if you attempt
1. Final variable
Final variable is a constant that cannot be changed once it is initialized.
Class Test1 {
final double PI = 3.14;//The name of the constant is best capitalized public
Test1 () {
PI = 3.14;
}
void Test () {
Final there are three scenarios, which are modified variables, methods, and classes, regardless of the modification, once declared as final type, you will not be able to change the reference, the compiler will check the code, if you attempt to
Java Programming related summary (ii)
Java Programming related Summary is a continuous update of the series, is my own years of work to use the Java experience of a summary, is also a new understanding of the temperature, because a lot of the
· Propercloneimplementation:object Clone () should is implemented with Super.clone ().
Translate the appropriate cloning implementation: The object's Clone () method should contain the Super.clone () implementation
·
Commonly used keywords in a class
1.FIANL: Lock2.self: Somewhat similar to the This keyword3.static: Static Properties4.const: constant keyword
1. Keywords: fianl
An important keyword used to define classes and methods, which cannot be inherited
First define the parent class and subclass
public class Parent {
protected static String a = "static";
Final String B = "final";
public static void Staticmethod () {
System.out.println (' This is a static method ');
}
The eighth chapter PolymorphicIn object-oriented programming language, polymorphism is the third basic feature following abstraction and skill. polymorphism can not only improve the organization and readability of code, but also create extensible
The call and return of each method of a virtual machine is accompanied by the stack frame's stack and stack, and each stack frame contains a reference to the method that the stack frame belongs to in the run-time pool (indicating which method the
1 swing is in AWT based on a set of new graphical interface system, it provides the awt All the functions that can be provided, and with pure java Span style= "font-family: the song Body;" The code extends the function of awt awt is a
In php, the final static $ this keyword is mainly used in classes or objects. Next I will record my final static $ this notes. For more information, see.
Final keywords
The php final keyword is used before a function or class name, indicating that
First, memory managementThe declaration in Java is a sub-reference and a basic data type.Array:An array of new objects in Java is person[] A; A = new Person[4]; person[0] = new Person ();the first sentence declares 1 A-array reference variable,
For more information about the touch event Learning Series, see:
Android Touch event Learning Series Summary
This article discusses Touch event Learning 1 Click Event on the basis of the previous article. However, the example is very simple and
Class07Overwrite (rewrite) and final keywordsOverwrite (rewrite): Writes a function that is exactly the same as the parent function in a subclass, implementing subclass-specific functionalityFinal keyword: Final translation comes to mean "final".
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:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.