Generics 如何在运行时检查类的字段(实例变量)是实例还是基本上是另一个类的对象?

Generics 如何在运行时检查类的字段(实例变量)是实例还是基本上是另一个类的对象?,generics,runtime,field,Generics,Runtime,Field,我正在开发一个银行应用程序,有两个类,即Account和Customer。 Account类的实例变量之一是Customer类的对象 abstract public class Account protected float balance; protected Customer[] C; //second parameter private static int object_number=600; public final int account_number; public Strin

我正在开发一个银行应用程序,有两个类,即Account和Customer。 Account类的实例变量之一是Customer类的对象

abstract public class Account 
protected float balance;
protected Customer[] C; //second parameter

private static int object_number=600;
public final int account_number;
public String type;
public int no_transactions;
public Date date_of_creation;

    public Account(String s_acc_type, int c_acc_balance,Customer[] *emphasized text*array_cust_obj,int nt)
    {
        object_number++;
        this.account_number=object_number;
        this.type=s_acc_type;
        this.balance=c_acc_balance;
        this.date_of_creation=new Date();
        if(this.type=="Fixed Deposit")
        {
        this.no_transactions=-1;
        }
        this.no_transactions=nt;
        this.C=array_cust_obj;
        System.out.println("Lenght of Passed array: "+C.length);
我正在编写一个我自己的通用记录器,我将account类型的对象传递给它

Field[] s;
s=obj.getClass().getSuperclass().getDeclaredFields();
我知道我的第二个参数,即s[1]是Customer类型的引用数组。 但是,如何在运行时检查此字段是基元类型(int,float)还是对象? 请帮忙