package com company class Bitcoin extends Thread Override public void

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.company;
class Bitcoin extends Thread{
@Override
public void run() {
for (int i = 0; i < 10; i++) {
System.out.print(i + " ");
}
}
}
public class Main {
public static void main(String[] args) {
Bitcoin b1 = new Bitcoin();
Bitcoin b2 = new Bitcoin();
b1.setPriority(1);
b2.setPriority(10);
b1.start();
b2.start();
}
}