2023-11-22から1日間の記事一覧
リフレクションの使い方 | ひだまりのなか、想ふこと // インスタンスの生成Piyo target = new Piyo();// 取得するメソッドの引数のクラスオブジェクトを取得Class argType = {Integer.class, Integer.class, String.class};// (privateな)hogehoge(Integer,…
junitテスト中に有用な情報を見つけた。 より詳しい原因がe.getCause()で取得できる。 Java での java.lang.reflect.InvocationTargetException エラーについて | Delft スタック import java.lang.reflect.*; public class Test { public int divideByZero(…