java getmethods_[求教]java里面调用getMethods()方法,问啥有些方法没有显示

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

package TextReflection;

import java.lang.reflect.InvocationTargetException;

import java.lang.reflect.Method;

import java.lang.reflect.Parameter;

public class testReflection {

public static void main(String arg[]) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {

String str = "TextReflection."+"TT";

Class c = Class.forName(str);

Object o = c.newInstance();

Method method[] = c.getMethods();

for(Method m:method) {

System.out.println(m.getName());

}

}

}

}

我的类定义如下:

class TT {

static {

System.out.println("TT is loaded");

}

int i;

TT() {

System.out.println("TT is constructed");

}

void m() {

System.out.println("TT");

}

void m2(int i ,int j) {

System.out.println(i+j);

}

}

为什么输出的结果是:

TT is loaded

TT is constructed

wait

wait

wait

equals

toString

hashCode

getClass

notify

notifyAll

我想问问我的m()跟m2()方法到哪去了,谢谢

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值