Chapter XIV: library use case analysis

Use StringBuffer

   StringBuffer define a class object, and a method of adding to a subject by the append () 26 lowercase letters, require the addition of a time, a total of 26 times is added, and then output in reverse manner, and may delete the first five characters.

  This process operation mainly StringBuffer class training method, since the main features of the content can be modified StringBuffer.

  StringBuffer because the content is allowed to be modified, but not allowed to modify the contents of String, and now the program is to develop a single-threaded, there is no need to consider concurrent access problems. (Not concurrent use StringBuffer or StringBuilder no difference)

Random array

  Generating a random integer between 1 and 30 (including 1 and 30) using the Random five classes.

  Generating a random number in operation Random will contain the number 0, so at this time there should be no problem with a digital zero.

Email verification

  Enter an Email address, then use regular expressions to verify the Email address is correct.

  For this case, the input data may be achieved through the command input parameters, if you want to verify, best practice is to set up a separate class verification process.

  If you later have more verification methods that require only expand in the Validator class.

Throw coins

 

 

 

 

 

 

 

 

 

 

 

IP verification

HTML split

country code

Compare Student Information

Guess you like

Origin www.cnblogs.com/djlindex/p/11276920.html