At times we write methods in Java classes with local variables that we need to access even after the methods finish execution. Here's an example:
public class FinalLocalVariableTest {
public static void main(String[] args) {
final int x = 5;