Can you instantiate an interface in Java
I know the quick answer is no. But I don’t understand something.
What's going on here:
SharedPreferences is an open interface:
http://developer.android.com/reference/android/content/SharedPreferences.html
However, we do not use this interface, as I read in books, we do not create a class and do not implement SharedPreferences. \
Instead, we use this API as follows:
SharedPreferences pref = Context.getSharedPreferences("some value", 0);
http://developer.android.com/reference/android/content/Context.html#getSharedPreferences(java.lang.String,%20int)
So what happens in this code?
I think its kind of getSharedPreferences () creates a SharedPreferences object that we can use and manipulate.
But SharedPreferences is an interface ... and I was told that you need to implement interfaces that do not create them.
What is this in Java?
Thanks so much for all the pointers.
(I'm still trying to learn)
follow along.
Java API, , Public Interface.
, ?