Is there a way to take an argument in a callable method?
You can’t pass it as the argument to call() because the method signature doesn’t allow it. However, you can pass the necessary information as a constructor argument; e.g. public class DoPing implements Callable<String>{ private final String ipToPing; public DoPing(String ipToPing) { this.ipToPing = ipToPing; } public String call() throws SomeException { InetAddress ipAddress = InetAddress.getByName(ipToPing); … Read more