SharedPreferences


Data storage Public

Easy  

3min


What is the value of String number after the following code snippet:

SharedPreferences pref = getApplicationContext().getSharedPreferences("MyPref", MODE_PRIVATE);
Editor editor = pref.edit();
editor.putString("1", "2");
editor.putString("3", "4");
String number = pref.getString("2", "3");