Try -catch signify that there could be an exception, means we are not sure whether the particular line of code in try-catch will execute or not. So for compiler it is not sure that whether the line which is initializing the variable x will run or not and hence throws an exception.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads