using System;
using System.Threading;
class ThreadTest
{
static void Main()
{
Thread t = new Thread(WriteY); // Kick off a new thread
t.Start(); // running WriteY()
// Simultaneously, do something on the main thread.
for (int i = 0; i < 10; i++)
Console.Write ("x");
}
static void WriteY()
{
for (int i = 0; i < 10; i++)
Console.Write("y");
}
}
The output:
yyyyyyyyyyxxxxxxxxxx| w___w_w__.j_a___va_2__s___.c__o__m | Contact Us |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |