how to call a java method using a variable name? April 9, 2024 by Tarik Use reflection: Method method = WhateverYourClassIs.class.getDeclaredMethod("Method" + MyVar); method.invoke();