Thread.currentthread ()

clipboard.png

this string of code is located in the concurrency section of Think In Java

as shown in the picture, I would like to ask you, what does the 1 or 10 after this pool-1-thread-6,pool-1-thread-2,pool-1-thread-3, mean? I am puzzled

Mar.02,2021

public String toString() {
        ThreadGroup group = getThreadGroup();
        if (group != null) {
            return "Thread[" + getName() + "," + getPriority() + "," +
                           group.getName() + "]";
        } else {
            return "Thread[" + getName() + "," + getPriority() + "," +
                            "" + "]";
        }
    }

that number represents priority, (min) 1-10 (max).

Menu