I have a method where am calling executor.sumbit() as below,
List<Stock> stockList ;
executor.submit( ()-> {
stockList = stockService.getAllStocks();
});
I'm facing "Local variable stockList defined in an enclosing scope must be final or effectively final" compiler error. I tried solve with help of Google but no luck :-(
Any help or suggestion appreciated, thanks!