Tag: error-handling

error handling – Does a finally block always get executed in Java?

The Question : 2442 people think this question is useful Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is? The Question Comments : If it didn’t, the keyword should be named probably instead. Not always Effective java says otherwise informit.com/articles/article.aspx?p=1216151&seqNum=7 @BinoyBabu, finalizer != finally; finalizer

IndexOutOfBoundsException SharedPreferences

问题内容: I read many posts even though I didn’t get the solution.My Scenario is, In My activity1 (first activity of tabhost) , I have a shared preferences in which I have stored a string set as, Set<String> arr = new HashSet<String>(); arr.add("term"); arr.add(((EditText) scrollView.findViewById(R.id.loan)).getText().toString()); arr.add(((EditText) scrollView.findViewById(R.id.emi)).getText().toString()); arr.add(((EditText) scrollView.findViewById(R.id.interest)).getText().toString()); SharedPreferences.Editor edit = savedloan.edit(); edit.putStringSet(input.getText().toString(), arr);//String in