There are several classes of the form:
package ru.com.project.service; public class Hashing { public static String Hash ( String data ) { return data; } } I'm trying to call the method of the desired class by the name:
String serviceName = "Hashing"; String serviceMethod = "Hash"; Class service = Class.forName( "ru.com.project.service." + serviceName ); Method classMethod = service.getMethod( serviceMethod ); The class is located, and return
service.getMethods() there is a required method, but on the line
Method classMethod = service.getMethod( serviceMethod ); a mistake falls
(java.lang.NoSuchMethodException) java.lang.NoSuchMethodException: ru.project.service.Hashing.Hash ()
What he doesn't like, I don't understand ...