[問題] Retrieving runtime parameter values
Hi
Java 是否可比在 runtime的時後 抓取 parameter 傳進來的 值?
比如說, 有個 function
public Integer add(Integer a, Integer b){
Integer c = a + b*2;
return c;
}
程式執行時 傳入
Integer result = add(1, 2);
是不是 有 method or api 可以取得 a, b (i.e. a=1, b=2) 的值呢?
查了 java.lang.reflect.Method 只看到 可取得 parameter type 的method.
好像沒有辦法取得 值.
Thaanks in advice,
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 87.194.42.127
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 6 篇):