Cannot refer to a non-final variable inside an inner class defined in a different method
Java doesn’t support true closures, even though using an anonymous class like you are using here (new TimerTask() { … }) looks like a kind of closure. edit – See the comments below – the following is not a correct explanation, as KeeperOfTheSoul points out. This is why it doesn’t work: The variables lastPrice and … Read more