Java and the use of the Final keyword
问题 I'm new to Java having programmed in Delphi and C# for some time,. My question relates to the usage of the "final" keyword on a variable that holds an instantiated class when the variable declaration and instantiation both happen within the scope of the same method. e.g. private String getDeviceID() { //get the android device id final TelephonyManager tm = (TelephonyManager)GetBaseContext().getSystemService(Context.TELEPHONY_SERVICE); final String deviceID = tm.getDeviceId(); // log debug