Hello, I'm trying to get a private method:
private static int getValue(String input) { char[] value = input.toCharArray(); if(value[0] == '0') return Integer.valueOf(String.valueOf(value[1])); return Integer.valueOf(input); } like this:
Method testGetValue = Seconds.class.getMethod("getValue", String.class); testGetValue.setAccessible(true); int i = (Integer)testGetValue.invoke(s, "00"); on this line
Method testGetValue = Seconds.class.getMethod("getValue", String.class); throws a NoSuchMethodException exception. How to fix?