Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {

        Thread t = Thread.currentThread();
        System.out.println("Thread = " + t);

        t.setName("java2s.com thread");

        System.out.println("Thread after changing name = " + t);

        int count = Thread.activeCount();
        System.out.println("currently active threads = " + count);
    }
}