[Java learning notes] Static import and java learning notes Import

Source: Internet
Author: User

[Java learning notes] Static import and java learning notes Import

1 package p2; 2 3 // import static java. util. collections. max; 4 5 import java. util. arrayList; 6 import static java. util. collections. *; // static import, which is actually a static member of the Class 7 import java. util. list; 8 import static java. lang. system. *; 9 10 public class news {11 12 public static void main (String [] args) {13 List <String> list = new ArrayList <String> (); 14 15 list. add ("abc1"); 16 list. add ("abc16"); 17 list. add ("abc13"); 18 19/* Collections. */sort (list); 20/* System. */out. println (list); 21 22 String max =/* Collections. */max (list); 23 System. out. println ("max =" + max); 24 25} 26 27}

 

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.