When it comes to the final keyword, it's probably a lot of people who are not unfamiliar with the final keyword when using anonymous internal classes. In addition, the string class in Java is a final class, so today we'll look at the use of the
2017-11-05 15:08:47
Final keyword
The Java keyword final has the meaning of "This cannot be changed" or "final state", which can be used to modify non-abstract classes, non-abstract class member methods, and variables.
There
Nodejs's crypto module public key encryption and decryptionNodejs has the following 4 classes related to public key cryptography.1. Cipher: Used for encrypting data;2. Decipher: Used to decrypt data;3. Sign: Used to generate signatures;4. Verify:
1. The modifiers of the class are divided into two types: accessible and non-access control characters.
The accessibility control characters are: public class modifiers
Non-access control characters are: abstract class modifier abstract; final
1, the class of modifiers are divided into: access control and non-access control characters two.The accessible control is: public class modifierThe non-access control characters are abstract class modifiers, and final class modifier final1) public
Final is not commonly used in Java, but it provides functions such as defining constants in C language, final also allows you to control whether your members, methods, or a class can be overwritten or inherited. These features enable final to play
Java static, this, super, final usage
I. Static
Take a look at the following program:
Public class Hello {Public static void main (string [] ARGs) {// (1)System. Out. println ("Hello, world! "); // (2)}}
I have read this program,
Sync blog address: http://august.b3log.org/articles/2012/07/16/1342420675028.html
Yesterday, a group of friends in a group asked if the final method could be reloaded. I did not think that the final method cannot be inherited and cannot be reloaded.
When it comes to the final keyword, it's probably a lot of people who are not unfamiliar with the final keyword when using anonymous internal classes. In addition, the string class in Java is a final class, so today we'll look at the use of the
Final classthe final class cannot be inherited, and once the class is modified with final, it means that all the methods in the final class are implicitly specified as the final method
Final methodin the process of inheriting a class, subclasses
What it says is "this part is not modifiable". There are two reasons not to be changed: efficiency, design. There are three things to use in final: data, methods, classes.First, final data
Sometimes the constant invariant of data is very useful,
1. The final class cannot be inherited, so the member methods of the final class have no chance of being overwritten, and the default is final. In the design class, if the class does not need to have subclasses, the implementation details of the
Summarizing class and object of learning content of textbook
Definition: An object, as opposed to a procedure.
There are 2 types of variables in Java, one is the base type and the other is the class type. The basic type has been learned
Final is not commonly used in Java, but it provides functions such as defining constants in C language, final also allows you to control whether your members, methods, or a class can be overwritten or inherited. These features enable final to play
I accidentally saw an article saying: The final modifier can improve the performance.
So I found two ways to improve the performance:
1:Final method:When a method is modified with "final", it indicates that the method cannot be overwritten by the
Final:Final allows you to control whether your members, methods, or a class can be overwritten or inherited. These features make final an indispensable role in Java, it is also one of the keywords that must be known and mastered when learning Java.
First, Powermock OverviewToday's more popular mock tools, such as Jmock,easymock,mockito, have one common drawback: they cannot mock static, final, private methods, and so on. And Powermock can perfectly compensate for the shortcomings of the above
Source: Haizi talked about the final keyword, presumably a lot of people are not unfamiliar, in the use of anonymous internal classes may often use the final keyword. In addition, the string class in Java is a final class, so today we'll look at the
Difference and usage of final, finally, and finalize in Java, finalfinalize
1. Simple differences:Final is used to declare attributes. Methods and classes indicate that attributes cannot be exchanged, methods cannot be overwritten, and classes
7 Reuse Class7.1 CombinationThat is, using another class as a member variable in one class, which is the function of reusing the existing program code, not the form.7.2 Inheritance
Keywords: extends, this reuse is a form of reuse, is a scalable
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.