小编Nec*_*vil的帖子

需要打印调用时使用的函数实际参数名称

我想在函数中打印函数实际参数名.

供参考,请参考下面的代码.这里我正在尝试反思.

class Refrction
{
    public static int a=12;
    public static int b=12;
    public static int c=13;

    public void click(int x)
    {
        Class cls=Refrction.class;
        Field[] fields = cls.getFields();               

        //here i want to print "a" if function actual parameter is "a" while calling the click function
        //here i want to print "b" if function actual parameter is "b" while calling the click function
        //here i want to print "c" if function actual parameter is "c" while calling the click function

    } …
Run Code Online (Sandbox Code Playgroud)

java reflection performance swing

2
推荐指数
1
解决办法
59
查看次数

标签 统计

java ×1

performance ×1

reflection ×1

swing ×1