Each resource has an ID number held in a static variable that belongs to one of the static inner classes in R. The name of that static variable is the very same name we specify as the name of the resource. It can be name of the string (string resource), the name of the image file (drawable resource), the name of the array (array resource), the name of the xml layout file (layout resource) etc. The name of the resource must obey the same rules that apply when creating a simple variable in Java. The following video clip provides a more detailed explanation.
The Visitor Design Pattern
The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.