String className = "mocktest.Calculator"; Class<?> myClass = Class.forName(className); Constructor constructor = myClass.getConstructor(); Calculator cal = (Calculator) constructor.newInstance(); System.out.println(cal.add(1, 1));
댓글 없음:
댓글 쓰기