Well, the main purpose is learning, so it is a kind of exercise for myself. Also, I must recognize that I have done things with Java but still don't feel totally comfortable with it.
Let's suppose I want to declare, fully in Java, an object "dot_in_a_line" with some members (variables and functions)
int xpos; // not visible from the outside
int step; // not visible
init( x_ini,step_ini ) --> sets xpos=x_ini, step=step_ini
goright() --> sets xpos+=step
goleft() --> sets xpos-=step
int getpos() --> returns xpos
And then want to declare N instances of this object from b4a and use them.
Usually I declare a class in B4A to achieve this and then I can instantiate as many objects as I want.