‫The third step is to create the modal class, which is a data class that acts as a structure for holding
‫the information for every item of recycler view.
‫In our example, we have only one image view and one text view.
‫So the image view is referred as integer and text view referred as string variable.
‫Let's go to the project, create a new Java class and I'll name it as sport.
‫Click okay.
‫This class will act as a modal class.
‫Inside it, I'll define two variables one of type string called sport name and the second is of type
‫integer plus insert.
‫To create the constructor having these two variables, then I need to create the getters and setters.
‫And here we go.
‫The modal class is a simple class that defines the structure of the data you want to work with.
‫In this case, we're going to work with sports and we have two things to display the image of the sport
‫and the title or the name of the sport.
‫So for that I define this data structure for our application.
‫And of course we created this constructor to create instances of sport class.
‫And when you create a new object of the sport class, we need to pass the values of the sport name and
‫the sport image.
‫And the getters and setters are used to retrieve and set the values of the private fields from outside
‫the class.