I can generate getters and setters in java program and I know that it is used to access private variables. Besides this How will I be able to decide this, at this point I need to create java class with getters and setters.
Getter and Setter methods are used for encapsulate
the data.
it means wrapping the data into single unit.
For example create a ListView
with 3 TextView
who has different-different value.
so now the question is how will you send the data to your custom ListView
adapter. In this case you have to use a beam(has getter-setter methods) class.
Here is another example it will show how to send multiple data by single object from one Activity to another Activity