Summary of category and summary of category

Source: Internet
Author: User

Summary of category and summary of category

1. Constructor

Upload (File source)
Merge (InputStream source)
Trim (String source)

 

Reference: http://blog.sina.com.cn/s/blog_7014ad5c01018sov.htm2.method
1 bytes in = new bytes (System. in); // enable scanner 2 // 1. hasNext () 3 System. out. println (in. hasNext (); // output time: the first input data receives the "Save and wrap" command (that is, "Carriage Return"). 4 5 // 2. View "Default split method" 6 Pattern p = in. delimiter (); 7 System. out. println (p);/** output: \ p {javaWhitespace} + <white space> */8 9 // 3. Modify "Default split mode" 10 p = Pattern. compile ("_"); 11 in. useDelimiter (p); // modify next (), nextXXX () (except nextLine). The default "segmentation method" 12 System. out. println ("[test splitting method] enter the test string;"); 13 St Ring s = in. next ();/** input: a_ B _c */14 System. out. println (s);/** output; changed (changed to '_'): "a" | not changed (default 'space '): "a_ B _c" */15 16 // 4. Differences between next () and nextLine () 17 System. out. println ("test next and nextLine] enter the test string;"); 18 // accept input 19 s = in. next ();/** input: a_ B _c */20 // s = "a", move the cursor to c and then space 21 // is the cursor at the beginning of the line? NO --> do not accept input (return the part after c in the previous line ("a_ B _c") -- Null String) 22 s = in. nextLine (); // s = "", line feed 23 // is the cursor at the beginning of the line? YES --> Accept input 24 s = in. nextLine ();/** input: a_ B _c */25 // s = "a_ B _c", line feed 26/** 27 * conclusion: 28 * similarities: "Save and wrap" condition -- press ENTER 29 * different points: scan mode, split mode 30 **/31 // 5, close () 32 in. close (); // close the scanner

 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.