public class Solution2 {
public static void main(String[] args) throws Exception {
Button button = new Button();
button.onClick("view");
int position = button.getPosition();
}
}
interface Clickable {
void onClick(String view);
}
class Button implements Clickable {
private int position;
@Override
public void onClick(String view) {
int pos = 10;
position = pos;
}
public int getPosition() {
return position;
}
}