Java syntax with greater than/less than: <> are they class specific?

前端 未结 4 2005
萌比男神i
萌比男神i 2021-01-01 18:20

I\'ve been doing an Android tutorial and encountered a class with the following:

public class ImageAndTextAdapter extends ArrayAdapter {
         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-01 18:42

    This is part of Generics which was introduced in Java1.5, Sometimes you don't know what type of object you can pass or get, so you can pass a generic type of object "?". In this particular instance, you are passing ArrayAdapter object which contains String objects. you can read more http://en.wikipedia.org/wiki/Generics_in_Java

提交回复
热议问题