Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    /**
     * Returns a list of classes containing the class of the object and all its super classes
     * 
     * @author Tristan Bepler
     */
    private static List<Class<?>> getSupers(Object o) {
        List<Class<?>> classes = new ArrayList<Class<?>>();
        Class<?> curClass = o.getClass();
        while (curClass != null) {
            classes.add(curClass);
            curClass = curClass.getSuperclass();
        }
        return classes;
    }
}