Java can determine whether a string contains Chinese Characters in two ways, but the principles are the same. It is determined by Unicode encoding, because the Chinese character encoding range in Unicode is 0x4e00 -- 0x9fbb.
First:
String
Configuration files are indispensable in the application system and can be addedProgramFlexibility. java. util. properties is a class from jdk1.2 and supports Load() Method. After jdk1.4, save (output, string) is changed to store (output, string)
Csdn Forum http://www.csdn.net/China's most famous Technology Forum ,《ProgramClerk magazine is published by them. You can ask a question on it and someone will answer you immediately. If you think it is good, you can add extra points to the person;
// Obtain the maximum, minimum, maximum, and minimum Int [] Nums = {12, 89, 3, 65, 74 }; Int max = Nums [0]; // maximum value Int min = Nums [0]; // minimum value For (int I: Nums ){ If (I> MAX ){ Max = I; } If (I Min = I; } } Int
I spoke about Java error handling today, and it was quite surprising that it was in a smallProgramSection:
Public int ADV (int A, int B)
{
Int result = 0;
Try
{
Result = A/B;
Return result;
} Catch (exception E)
{
E. printstacktrace ()
The string class in Java is in the Java. lang package.String STR = new string ();Str. length () is used to prevent Str. length = 4.In addition, STR and length () have a feature that both Chinese and English are regarded as one length, rather than
Equality of test objects: Although = and! = Can be used for all objects, but the result may not be what you want. Except for the original data type,= And! = When two objects are compared, the reference of the two objects is compared, but what we
Hiding the implementationThis sentence is very good:In any relationship, it's important to have boundaries that are respected by all parties involved.Regardless of your relationship, it is important to have a line of mutual respect.
#----Classpath
Polymorphism
Polymorphism is also known as dynamic binding of "dynamic binding", "late binding", or "Run-Time bingding" at runtime 』.It means that the method to bind depends on the object type when the program is running. Polymorphism is the third
Java1.5 provides a function called varargs, which is a variable length parameter.In previous JDK versions, the number of input parameters of a method in an object is fixed after being written, and varargs provides the variable length function,
/*** Generate an XML file* @ Throws ioexception* @ Throws jdomexception*/Public void buildxmldoc () throws ioexception, jdomexception {// Create a list of root nodes;Element root = new element ("country ");Root. setattribute ("code", "86 ");Root.
From: http://xumiao900.iteye.com/blog/477778
Compare the efficiency of connecting strings of the string, stringbuffer, and srtingbuilder objects in Java.
We often hear experienced people say that we should avoid using strings to connect strings
Use MD5 for encryption in Java
In the development of various application systems, user information is often stored. In many places, user passwords must be stored, and direct storage of user passwords on servers is obviously insecure, this article
Persistence stores Java Virtual Machine objects permanently, instead of ing databases into objects. Data is usually stored in databases. Of course, if you have a better storage system, it can also be mapped to storage devices in the system. This may
Java interview questions (answer)First, let's talk about the differences between final, finally, and finalize.Final? Modifier (keyword) If a class is declared as final, it means that it cannot generate a new subclass and cannot be inherited as a
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service