Getting current thread info

Report a typo

Implement a method that prints the information about the thread executing this method. The information includes the thread's name and its priority.

Don't forget to specify what is the data in the output. Here is the output example:

name: my-thread
priority: 5
Write a program in Java 17
class Info {

public static void printCurrentThreadInfo() {
// get the thread and print its info
}
}
___

Create a free account to access the full topic