The inheritance thread method implements multithreading
public class Test extends Thread {
public void Run ()
{
System.out.println (This.getname ());
}
public static void Main (string[] args)
{
System.out.println (Thread.CurrentThread (). GetName ());
Test thread1 = new test ();
Test thread2 = new test ();
Thread1.start ();
Thread2.start ();
}
}
Implement Runnable interface method to realize multithreading/*1. Instantiates the class that implements the Runnable interface.2. Create a thread ob
Thinking about it: When I saw this problem, I immediately thought of the HDU 1496, the two topics have similarities. My personal hdu1496: Click hereSave all the first and second numbers and A + B, record the number of occurrences of each number, and then calculate each C + D, for each C + D, the query-(c + D) appears several times.So the subject needs a way to save all A + B's and its occurrences.The most straightforward approach is to use the map in the STL, but the map is easy to time out when
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.