Really there is not much difference.
Both are easy to achieve.
Especially if you compare it with C/C++
(which is different from one OS to another).
C# :
using System;
using System.Threading;
public class Test {
static void SomeThreadJob() {
// do something here
}
public static void Main(String[] args) {
ThreadStart job = new ThreadStart( SomeThreadJob);
Thread thread = new Thread(job);
thread.Start();
}
}
Java :
public class Test {
static class SomeThreadJob implements Runnable {
public void run() {
// do something here
}
}
public static void main(String[] args) {
SomeThreadJob job = new SomeThreadJob();
Thread thread = new Thread(job);
thread.start();
}
}
There are many different ways to do this, especially in Java,
but I wanted to show how much both languages can look alike.
Regards