Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.ref.Reference;

import java.util.Arrays;

public class Main {
    static void printObject(Object obj) {
        System.out.println("find threadlocal var:" + obj);
        if (obj instanceof Object[]) {
            System.out.println("array:" + Arrays.deepToString((Object[]) obj));
        } else if (obj instanceof Reference) {
            Reference ref = (Reference) obj;
            System.out.println("ref: " + ref.getClass().getName() + ",ref to " + ref.get());
        } else {
            System.out.println("others: " + obj);
        }
    }
}