I have created a piece of code which takes an IP address (from main method in another class) and then loops through a range of IP addresses pinging each one as it goes. I ha
Adding to Jarle's answer -- in case you create Callable as instance of anonymous class, you can use final field outside of anonymous class for passing data into the instance:
final int arg = 64;
executor.submit(new Callable() {
public Integer call() throws Exception {
return arg * 2;
}
});