JAVAでメソッドの戻り値の型を見つけるのを手伝ってくれる人はいますか? これを試しました。しかし、残念ながらうまくいきません。私を案内してください。
Method testMethod = master.getClass().getMethod("getCnt");
if(!"int".equals(testMethod.getReturnType()))
{
System.out.println("not int ::" + testMethod.getReturnType());
}
出力:
int ではない ::int