putInt() and getInt()

whats the significance of the method putInt in savedInstanceState.putInt(KEY_INDEX, mCurrentIndex) and getInt in savedInstanceState.getInt(KEY_INDEX, 0) on page 69 & 70.
also how does it work?

Your bundle is for saving (Activity) instance data over the activities destruction. It kind of works like a hashmap, so you can save data using String keys. Later you read the data at that particular String key to retreive the saved data.

The second (optional) parameter to getInt(String, int) is the default value in case that no entry with that String key exists in the bundle.