Java supports multithreading at the language level

Source: Internet
Author: User

Process: Task

Task concurrency execution is a macro concept, which is a micro-serial.

Process scheduling is OS-owned (some systems are exclusive, some systems are shared, and processes are prioritized according to importance).

The time is divided by the OS into a number of time slices.

Java supports multithreading at the language level.

The time allotted is still the OS.

1 Package tomtexts;2 3  Public classtomtexts_21 {4      Public Static voidMain (String args[])5     {6     intdata1[]={2,4,6,8,Ten, A};7     intdata2[]={1,0,2,4,3};8     Try9     {Ten      for(intI=0; i<data1.length;i++) { One     Try{ ASystem. out. println (data1[i]+"/"+data2[i]+" is"+data1[i]/data2[i]); -     } -     Catch(arithmeticexception e) the     { -System. out. println ("cannot be removed by 0! "); -     } -     } +     } -     Catch(arrayindexoutofboundsexception e) +     { ASystem. out. println ("The program is terminated! "); at     } -     } -  -}

Java supports multithreading at the language level

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.