I know that Threads can have Priority ranging from MIN_PRIORITY(1) to MAX_PRIORITY(10). However, if I have more than 10 threads to execute, how will I assign priority to them ? Can the priority be more than 10 ?
However, if I have more than 10 threads to execute, how will I assign [a different] priority to [each of] them ?
You can't.
But it should not matter. The chances are that thread priorities will only give you a rough prioritization anyway. Certainly, the javadocs do not give any strong guarantees about how (or even if) thread priorities affect thread scheduling.
The actual implementation of thread scheduling and thread priorities on a modern JVM is done by the operating system's thread scheduler. Java Thread
priorities are really little more than a "hint" to the operating system.
The bottom line is that an Java application that relies on thread priorities for correct behaviour is likely to be unreliable, and to behave differently / incorrectly if run on a different platform to the one you originally developed / debugged for. You should never rely on priorities for correct behaviour. Use the synchronization primitives provided to ensure that things occur in the required order.
If you need precise behaviour of thread priorities, you will need to use a "real-time Java" JVM running on top of a "real-time operating system".