You need to change the variable to the number 3:
private int step = 1; Using the static method:
public static void onDoubleTap() { //-----Получить переменную и изменить её----- System.out.println("Переменная изменена на число 3"); } The static variable is not necessary!
public static void onDoubleTap(ClassName instance) { instance.step+=3; }public static void onDoubleTap(ClassName instance) { instance.step+=3; }then it will be necessary to cause so:ClassName.onDoubleTap(classNameInstance). But it seems to me that you are trying to solve an unknown task in some wrong way. - Yuriy SPb ♦