0

I'm quite familiar with Java as I'm actually creating my own app. But I have a few questions on advanced java codes... I'm actually trying to save a String Array in the SharedPreferences to restore a screen after the app have been exited by the home button. So I found these two links : How to make an android app return to the last open activity when relaunched? and Is it possible to add an array or object to SharedPreferences on Android

I know what to do and how to do it so that's not the point of this topic.

My point is th fact that I'm not familiar with the constructors using parameters between <> instead of (), I don't understand what is the difference with a "classic" constructor.

By example, for my project, a few days ago, I used ArrayAdapters ( http://developer.android.com/reference/android/widget/ArrayAdapter.html ) and to use a function like sort(Comparator comparator) , we have to use a Comparator<? super T>. What is that ?

Could somebody explain me how to use it (not especially for the sort method, but globally) cause I'm really lost and in my project, I use some faces of Android that I don't even understand !

Hope I've been clear, Thanks !

Community
  • 1
  • 1
beluga
  • 193
  • 3
  • 17

2 Answers2

3

You're seeing generic type parameters.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

That is a generic type. http://download.oracle.com/javase/tutorial/java/generics/generics.html

user12345613
  • 833
  • 9
  • 21