Home  >  Article  >  Java  >  What is the concept of Java user thread

What is the concept of Java user thread

WBOY
WBOYforward
2023-05-10 20:58:04787browse

1. Whether the Java language is a thread or a thread pool, it is a user thread by default, so user threads are also called ordinary threads.

2. Taking threads as an example, to check whether a trip is a daemon trip, just query by calling the isdaemon() method. If the query value is false, it means that it is not a daemon process, and of course it belongs to the user thread.

Example

public static void main(String[] args) throws InterruptedException {
    Thread thread = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("我是子线程");
        }
    });
    System.out.println("子线程==守护线程:" + thread.isDaemon());
    System.out.println("主线程==守护线程:" + Thread.currentThread().isDaemon());
}

What are the basic data types of java

The basic data types of Java are divided into:

1. Integer type , a data type used to represent integers.

2. Floating point type, a data type used to represent decimals.

3. Character type. The keyword of character type is "char".

4. Boolean type is the basic data type that represents logical values.

The above is the detailed content of What is the concept of Java user thread. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete